X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ffox1ihu%2Fflash-loader%2Fao_pins.h;h=31201eb0cae28bf099762338bf405bce0a91dfbe;hb=c408c773793b5a5685d95c11ba6f710200505c25;hp=3a942c9c3886ac79e47fc880114ed59f39639a91;hpb=e79202f95f0e5b4a01da31d3742a775bea62cc92;p=fw%2Faltos diff --git a/src/fox1ihu/flash-loader/ao_pins.h b/src/fox1ihu/flash-loader/ao_pins.h index 3a942c9c..31201eb0 100644 --- a/src/fox1ihu/flash-loader/ao_pins.h +++ b/src/fox1ihu/flash-loader/ao_pins.h @@ -21,13 +21,27 @@ /* 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 -/* 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_GPIO stm_gpiob +#define AO_BOOT_APPLICATION_PIN 8 #define AO_BOOT_APPLICATION_VALUE 0 #define AO_BOOT_APPLICATION_MODE 0