Skip to content

Commit 72e61ea

Browse files
committed
Fix independent_watchdog example
1 parent 362c099 commit 72e61ea

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

examples/independent_watchdog.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@
44
#![no_std]
55

66
//#[macro_use]
7-
//mod utils;
8-
use stm32g4xx_hal::{independent_watchdog::IndependentWatchdog, prelude::*, stm32::Peripherals};
7+
mod utils;
8+
use stm32g4xx_hal::{independent_watchdog::IndependentWatchdog, stm32::Peripherals, time::ExtU32};
99

1010
use cortex_m_rt::entry;
11-
12-
// TODO: Use utils instead
13-
use defmt::Logger;
14-
use defmt_rtt as _; // global logger
15-
use panic_probe as _;
16-
17-
use defmt::info; // TODO: Use utils::logger instead
11+
use utils::logger::info;
1812

1913
#[entry]
2014
fn main() -> ! {
@@ -33,7 +27,7 @@ fn main() -> ! {
3327

3428
// Enable the watchdog with a limit of 32.76 seconds (which is the maximum this watchdog can do) and wait forever
3529
// -> restart the chip
36-
watchdog.start(32_760.ms());
30+
watchdog.start(32_760.millis());
3731

3832
// Alternatively, there's also a windowed option where if the watchdog is fed before the window time, it will reset the chip as well
3933
// watchdog.start_windowed(100.millis(), 200.millis());

0 commit comments

Comments
 (0)