Skip to content

Commit

Permalink
test: Add a test with CpuClock::max()
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Sep 19, 2024
1 parent 9fa910b commit 892ed5d
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions hil-test/tests/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
#![no_main]

use esp_hal::{
config::WatchdogStatus,
delay::Delay,
prelude::*,
rtc_cntl::Rtc,
timer::timg::TimerGroup,
config::WatchdogStatus, delay::Delay, prelude::*, rtc_cntl::Rtc, timer::timg::TimerGroup,
Config,
};
use hil_test as _;
Expand Down Expand Up @@ -40,6 +36,27 @@ mod tests {
}
}

#[test]
#[timeout(3)]
fn test_feeding_timg0_wdt_max_clock() {
let peripherals = esp_hal::init({
let mut config = Config::default();
config.cpu_clock = CpuClock::max();
config.watchdog.timg0 =
WatchdogStatus::Enabled(fugit::MicrosDurationU64::millis(500 as u64));
config
});

let timg0 = TimerGroup::new(peripherals.TIMG0);
let mut wdt0 = timg0.wdt;
let delay = Delay::new();

for _ in 0..4 {
wdt0.feed();
delay.delay(250.millis());
}
}

#[test]
#[timeout(4)]
fn test_feeding_rtc_wdt() {
Expand Down

0 comments on commit 892ed5d

Please sign in to comment.