altos: Enable system timer in flash loader and prod watchdog with it
authorKeith Packard <keithp@keithp.com>
Sat, 1 Feb 2014 08:06:30 +0000 (00:06 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 9 Feb 2014 04:13:38 +0000 (20:13 -0800)
This makes it possible to reflash the board without needing to disable
the watchdog.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/product/ao_flash_pins.h
src/stm/ao_flash_loader_stm.c
src/stm/ao_timer.c

index dd67d820ea0f99f7cae75873448f1c9bdf4d247b..4917ee6f9f1f2eb00f364bb7ea146c5e9ccf4101 100644 (file)
@@ -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
 
index 2ab548cfa452a4fdfc2706e6b08125d61d3f8c04..6bf89234b702a18a9d9caa1a64b7ff9e84e1e463 100644 (file)
@@ -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;
 }
index 34f9edb90b084d40b5fbee14cdca7d313a03d30c..d93531fc7da8623d1e4531959f50ce8fea75cd51 100644 (file)
@@ -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
        }
 }