From 95d66438d267177876755151d4a606ba8965901c Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 11 Mar 2020 23:17:34 +0100 Subject: [PATCH] main: use sensible WATCHDOG_INTERVAL --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ae3f0db..01a182d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,6 +38,11 @@ mod timer; /// This should be a multiple of the `TIMER_RATE`. const OUTPUT_INTERVAL: u32 = 1000; +#[cfg(not(feature = "semihosting"))] +const WATCHDOG_INTERVAL: u32 = 100; +#[cfg(feature = "semihosting")] +const WATCHDOG_INTERVAL: u32 = 10_000; + #[cfg(not(feature = "generate-hwaddr"))] const NET_HWADDR: [u8; 6] = [0x02, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; @@ -82,7 +87,7 @@ fn main() -> ! { .freeze(); let mut wd = IndependentWatchdog::new(dp.IWDG); - wd.start(1000u32.ms()); + wd.start(WATCHDOG_INTERVAL.ms()); wd.feed(); let pins = Pins::setup(clocks, dp.GPIOA, dp.GPIOB, dp.GPIOC, dp.GPIOG, dp.SPI2);