add Rtc::disable_rom_message_printing (#2280)

This commit is contained in:
dimpolo 2024-10-07 16:07:04 +02:00 committed by GitHub
parent 897a67808c
commit f4540a5508
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Introduce `DmaRxStreamBuf` (#2242)
- Implement `embedded_hal_async::delay::DelayNs` for `TIMGx` timers (#2084)
- Added `Efuse::read_bit` (#2259)
- Added `Rtc::disable_rom_message_printing` (S3 and H2 only) (#2280)
### Changed

View File

@ -392,6 +392,25 @@ impl<'d> Rtc<'d> {
config.start_sleep(wakeup_triggers);
config.finish_sleep();
}
/// Temporarily disable log messages of the ROM bootloader.
///
/// If you need to permanently disable the ROM bootloader messages, you'll
/// need to set the corresponding eFuse.
#[cfg(any(esp32s3, esp32h2))]
pub fn disable_rom_message_printing(&self) {
// Corresponding documentation:
// ESP32-S3: TRM v1.5 chapter 8.3
// ESP32-H2: TRM v0.5 chapter 8.2.3
#[cfg(esp32s3)]
let rtc_cntl = unsafe { &*LPWR::ptr() };
#[cfg(esp32h2)]
let rtc_cntl = unsafe { &*LP_AON::ptr() };
rtc_cntl
.store4()
.modify(|r, w| unsafe { w.bits(r.bits() & 1) });
}
}
impl<'d> crate::private::Sealed for Rtc<'d> {}