Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Oct 29, 2024
1 parent 8cdfdf3 commit a50b27f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions esp-hal/src/timer/timg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,18 +983,18 @@ where
if !enabled {
reg_block.wdtconfig0().write(|w| unsafe { w.bits(0) });
} else {
reg_block.wdtconfig0().write(|w| w.wdt_en().bit(true));

reg_block
.wdtconfig0()
.write(|w| w.wdt_flashboot_mod_en().bit(false));

reg_block.wdtconfig0().write(|w| w.wdt_en().bit(true));

#[cfg_attr(esp32, allow(unused_unsafe))]
reg_block.wdtconfig0().write(|w| unsafe {
w.wdt_en()
.bit(true)
.wdt_stg0()
.bits(MwdtStageAction::Off as u8)
.bits(MwdtStageAction::ResetSystem as u8)
.wdt_cpu_reset_length()
.bits(7)
.wdt_sys_reset_length()
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/rtc_watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() -> ! {
rtc.set_interrupt_handler(interrupt_handler);

rtc.rwdt.enable();
rtc.rwdt.set_timeout(0, 2000.millis()).unwrap();
rtc.rwdt.set_timeout(0, 2.secs()).unwrap();
rtc.rwdt.listen();

critical_section::with(|cs| RWDT.borrow_ref_mut(cs).replace(rtc.rwdt));
Expand All @@ -49,7 +49,7 @@ fn interrupt_handler() {

println!("Restarting in 5 seconds...");

rwdt.set_timeout(0, 5000.millis()).unwrap();
rwdt.set_timeout(0, 5.secs()).unwrap();
rwdt.unlisten();
});
}

0 comments on commit a50b27f

Please sign in to comment.