Skip to content

Commit 964b3e4

Browse files
khrsTheZoq2
authored andcommitted
Add missing watchdog prescalers.
1 parent df0f47f commit 964b3e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/watchdog.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct IndependentWatchdog {
1212
}
1313

1414
const LSI_KHZ: u32 = 40;
15-
const MAX_PR: u8 = 4;
15+
const MAX_PR: u8 = 8;
1616
const MAX_RL: u16 = 0xFFF;
1717
const KR_ACCESS: u16 = 0x5555;
1818
const KR_RELOAD: u16 = 0xAAAA;
@@ -69,6 +69,9 @@ impl IndependentWatchdog {
6969
0b010 => 16,
7070
0b011 => 32,
7171
0b100 => 64,
72+
0b101 => 128,
73+
0b110 => 256,
74+
0b111 => 256,
7275
_ => panic!("Invalid IWDG prescaler divider"),
7376
};
7477
(u32::from(rl) + 1) * divider / LSI_KHZ

0 commit comments

Comments
 (0)