From cb46290e4d17d4cfc79d7c6feb24b6489a6331f3 Mon Sep 17 00:00:00 2001 From: Karol Harasim Date: Tue, 19 May 2020 12:47:02 +0200 Subject: [PATCH] Add missing watchdog prescalers. --- src/watchdog.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/watchdog.rs b/src/watchdog.rs index f8b7f012..f1bf3888 100644 --- a/src/watchdog.rs +++ b/src/watchdog.rs @@ -12,7 +12,7 @@ pub struct IndependentWatchdog { } const LSI_KHZ: u32 = 40; -const MAX_PR: u8 = 4; +const MAX_PR: u8 = 8; const MAX_RL: u16 = 0xFFF; const KR_ACCESS: u16 = 0x5555; const KR_RELOAD: u16 = 0xAAAA; @@ -69,6 +69,9 @@ impl IndependentWatchdog { 0b010 => 16, 0b011 => 32, 0b100 => 64, + 0b101 => 128, + 0b110 => 256, + 0b111 => 256, _ => panic!("Invalid IWDG prescaler divider"), }; (u32::from(rl) + 1) * divider / LSI_KHZ