Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix independent_watchdog example #90

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading