From f238b846168993955df3f8acb85b48a87cae1ec3 Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Tue, 29 Oct 2024 11:15:40 +0100 Subject: [PATCH] Document bootloader limitation + typo fix --- esp-hal/src/rtc_cntl/mod.rs | 6 ++---- esp-hal/src/timer/timg.rs | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/esp-hal/src/rtc_cntl/mod.rs b/esp-hal/src/rtc_cntl/mod.rs index b14700712c0..510e4545e05 100644 --- a/esp-hal/src/rtc_cntl/mod.rs +++ b/esp-hal/src/rtc_cntl/mod.rs @@ -915,14 +915,12 @@ impl Rwdt { rtc_cntl.wdtwprotect().write(|w| unsafe { w.bits(wkey) }); } - let rtc_cntl = unsafe { lpwr() }; - let rtc_cntl = unsafe { lp_wdt() }; fn set_enabled(&mut self, enable: bool) { let rtc_cntl = unsafe { lp_wdt() }; self.set_write_protection(false); - if !enabled { + if !enable { rtc_cntl.wdtconfig0().modify(|_, w| unsafe { w.bits(0) }); } else { rtc_cntl @@ -931,7 +929,7 @@ impl Rwdt { rtc_cntl .wdtconfig0() - .modify(|_, w| w.wdt_en().bit(enabled).wdt_pause_in_slp().bit(enabled)); + .modify(|_, w| w.wdt_en().bit(enable).wdt_pause_in_slp().bit(enable)); // Apply default settings for WDT unsafe { diff --git a/esp-hal/src/timer/timg.rs b/esp-hal/src/timer/timg.rs index d83877d9ed1..6d4815b29d0 100644 --- a/esp-hal/src/timer/timg.rs +++ b/esp-hal/src/timer/timg.rs @@ -1082,6 +1082,11 @@ where } /// Set the stage action of the MWDT for a specific stage. + /// + /// This function modifies MWDT behavior only if a custom bootloader with + /// the following modifications is used: + /// - `ESP_TASK_WDT_EN` parameter **disabled** + /// - `ESP_INT_WDT` parameter **disabled** pub fn set_stage_action( &mut self, stage: usize,