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

Disable APM in direct-boot mode #7

Merged
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions esp-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ pub mod interrupt;
#[cfg_attr(esp32s3, path = "peripherals/esp32s3.rs")]
pub mod peripherals;

#[cfg(esp32c6)]
pub fn disable_apm_filter() {
unsafe {
(&*esp32c6::LP_APM::PTR).func_ctrl.write(|w| w.bits(0));
(&*esp32c6::LP_APM0::PTR).func_ctrl.write(|w| w.bits(0));
(&*esp32c6::HP_APM::PTR).func_ctrl.write(|w| w.bits(0));
}
}

/// Enumeration of CPU cores
/// The actual number of available cores depends on the target.
pub enum Cpu {
Expand Down
2 changes: 2 additions & 0 deletions esp32c6-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ unsafe fn init() {
);

r0::init_data(&mut _srtc_fast_text, &mut _ertc_fast_text, &_irtc_fast_text);

esp_hal_common::disable_apm_filter();
}

#[allow(unreachable_code)]
Expand Down