summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-03-21 09:49:15 -0700
committerKeith Packard <keithp@keithp.com>2018-04-26 19:33:48 -0700
commite0c969910a516c018e64eaa73cdbe4bc2f979835 (patch)
tree00a2dd9dfe79b1ef738b13126e84234fbf720b33 /src
parent6adf9d2a17d701ed0ceb742f322fa72723149980 (diff)
altos/fox: Add watchdog timer
Runs at 25Hz, can be enabled and disabled via the command line Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/fox1ihu/Makefile3
-rw-r--r--src/fox1ihu/ao_fox1ihu.c2
-rw-r--r--src/fox1ihu/ao_pins.h6
3 files changed, 10 insertions, 1 deletions
diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile
index 714a308b..94315e79 100644
--- a/src/fox1ihu/Makefile
+++ b/src/fox1ihu/Makefile
@@ -41,7 +41,8 @@ ALTOS_SRC = \
ao_usb_stm.c \
ao_exti_stm.c \
ao_adc_stm.c \
- ao_data.c
+ ao_data.c \
+ ao_watchdog.c
PRODUCT=Fox1IHU-v1
PRODUCT_DEF=-DFOX
diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c
index 43ae2ea8..9f7821f7 100644
--- a/src/fox1ihu/ao_fox1ihu.c
+++ b/src/fox1ihu/ao_fox1ihu.c
@@ -44,6 +44,8 @@ main(void)
ao_usb_init();
+ ao_watchdog_init();
+
ao_start_scheduler();
return 0;
}
diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h
index 09fd5e99..e73ef63a 100644
--- a/src/fox1ihu/ao_pins.h
+++ b/src/fox1ihu/ao_pins.h
@@ -244,4 +244,10 @@ struct ao_adc {
#define AO_ADC_SQ13 AO_ADC_TEMP
#define AO_ADC_SQ13_NAME "temp"
+/* Watchdog timer */
+
+#define AO_WATCHDOG_INTERVAL AO_MS_TO_TICKS(40)
+#define AO_WATCHDOG_PORT (&stm_gpiod)
+#define AO_WATCHDOG_BIT 3
+
#endif /* _AO_PINS_H_ */