had the sense backwards .. presence of 'attached' should put us in the loader
[fw/altos] / src / fox1ihu / flash-loader / ao_pins.h
index bcc3cc9c18c0c324672db5e3bb4760333f215530..31201eb0cae28bf099762338bf405bce0a91dfbe 100644 (file)
 /* External crystal at 8MHz */
 #define AO_HSE         8000000
 
+#define AO_WATCHDOG_PORT       (&stm_gpiod)
+#define AO_WATCHDOG_BIT                3
+
+#define AO_FLASH_LOADER_INIT do {                                              \
+               ao_enable_output(AO_WATCHDOG_PORT, AO_WATCHDOG_BIT, AO_WATCHDOG, 0); \
+       } while (0)
+       
+#define AO_TIMER_HOOK  do {                                            \
+               static uint8_t  watchdog;                               \
+               ao_gpio_set(AO_WATCHDOG_PORT, AO_WATCHDOG_BIT, AO_WATCHDOG_PIN, watchdog); \
+               watchdog ^= 1;                                          \
+       } while (0)
+
+#define HAS_TICK               1
 #include <ao_flash_stm_pins.h>
 
-/* Detatched signal, PD6 */
+/* Attached signal, PB8 */
 
 #define AO_BOOT_PIN            1
-#define AO_BOOT_APPLICATION_GPIO       stm_gpiod
-#define AO_BOOT_APPLICATION_PIN                6
-#define AO_BOOT_APPLICATION_VALUE      1
+#define AO_BOOT_APPLICATION_GPIO       stm_gpiob
+#define AO_BOOT_APPLICATION_PIN                8
+#define AO_BOOT_APPLICATION_VALUE      0
 #define AO_BOOT_APPLICATION_MODE       0
 
 #endif /* _AO_PINS_H_ */