summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-02-01 00:06:30 -0800
committerKeith Packard <keithp@keithp.com>2014-02-08 22:03:19 -0800
commitd35aab94127a8bd5017a5142aaf02f840d5616d0 (patch)
tree79ad84b5889eb948e0f6b9c6d8fd396d0e3ea8e6
parent8b95414539dbdb13b34868636792eb7444376c18 (diff)
altos/fox: 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 <keithp@keithp.com>
-rw-r--r--src/fox1ihu/flash-loader/ao_pins.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fox1ihu/flash-loader/ao_pins.h b/src/fox1ihu/flash-loader/ao_pins.h
index 3a942c9c..90917a38 100644
--- a/src/fox1ihu/flash-loader/ao_pins.h
+++ b/src/fox1ihu/flash-loader/ao_pins.h
@@ -21,6 +21,20 @@
/* 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 */