altos/fox: Add watchdog timer
authorKeith Packard <keithp@keithp.com>
Thu, 21 Mar 2013 16:49:15 +0000 (09:49 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 27 Apr 2018 02:33:48 +0000 (19:33 -0700)
Runs at 25Hz, can be enabled and disabled via the command line

Signed-off-by: Keith Packard <keithp@keithp.com>
src/fox1ihu/Makefile
src/fox1ihu/ao_fox1ihu.c
src/fox1ihu/ao_pins.h

index 714a308b84329b8f0d9a7cc957979bca0b411889..94315e794420bda28b11b5b73e99bcfad8c4f3c4 100644 (file)
@@ -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
index 43ae2ea8146dd925eb538408be1ec17d5be6ec29..9f7821f7916451b10c8abe978f07821ecd69f2e3 100644 (file)
@@ -44,6 +44,8 @@ main(void)
 
        ao_usb_init();
 
+       ao_watchdog_init();
+
        ao_start_scheduler();
        return 0;
 }
index 09fd5e992347ff1e246bc54b339f0a7b5dab8386..e73ef63ad116b3bd39f6118e2b7205ea1a71adca 100644 (file)
@@ -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_ */