From: Keith Packard Date: Sat, 1 Feb 2014 08:06:30 +0000 (-0800) Subject: altos: Enable system timer in flash loader and prod watchdog with it X-Git-Tag: 1.3.2~10 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=d6d56c20465455b759f60a03fc96aa228ab9102e altos: Enable system timer in flash loader and prod watchdog with it This makes it possible to reflash the board without needing to disable the watchdog. Signed-off-by: Keith Packard --- diff --git a/src/product/ao_flash_pins.h b/src/product/ao_flash_pins.h index dd67d820..4917ee6f 100644 --- a/src/product/ao_flash_pins.h +++ b/src/product/ao_flash_pins.h @@ -27,7 +27,9 @@ #define HAS_BEEP 0 #define HAS_TASK 0 #define HAS_ECHO 0 +#ifndef HAS_TICK #define HAS_TICK 0 +#endif #define PACKET_HAS_SLAVE 0 diff --git a/src/stm/ao_flash_loader_stm.c b/src/stm/ao_flash_loader_stm.c index 2ab548cf..6bf89234 100644 --- a/src/stm/ao_flash_loader_stm.c +++ b/src/stm/ao_flash_loader_stm.c @@ -27,6 +27,13 @@ main(void) ao_usb_init(); +#if HAS_TICK + ao_timer_init(); +#endif + +#ifdef AO_FLASH_LOADER_INIT + AO_FLASH_LOADER_INIT; +#endif ao_flash_task(); return 0; } diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index 34f9edb9..d93531fc 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -52,6 +52,9 @@ void stm_systick_isr(void) ao_wakeup((void *) &ao_data_count); #endif } +#endif +#ifdef AO_TIMER_HOOK + AO_TIMER_HOOK; #endif } }