Skip to content

Commit

Permalink
Merge pull request #90 from no111u3/fix_watchdog
Browse files Browse the repository at this point in the history
Fix independent_watchdog example
  • Loading branch information
no111u3 authored Nov 28, 2023
2 parents 362c099 + 72e61ea commit 4d3dc74
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions examples/independent_watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@
#![no_std]

//#[macro_use]
//mod utils;
use stm32g4xx_hal::{independent_watchdog::IndependentWatchdog, prelude::*, stm32::Peripherals};
mod utils;
use stm32g4xx_hal::{independent_watchdog::IndependentWatchdog, stm32::Peripherals, time::ExtU32};

use cortex_m_rt::entry;

// TODO: Use utils instead
use defmt::Logger;
use defmt_rtt as _; // global logger
use panic_probe as _;

use defmt::info; // TODO: Use utils::logger instead
use utils::logger::info;

#[entry]
fn main() -> ! {
Expand All @@ -33,7 +27,7 @@ fn main() -> ! {

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

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

0 comments on commit 4d3dc74

Please sign in to comment.