Don't enable the interrupt when waiti isn't used (#3116)

This commit is contained in:
Dániel Buga 2025-02-07 14:29:33 +01:00 committed by GitHub
parent 235ee624f8
commit bb92715f6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,7 @@ pub struct Executor {
impl Executor {
/// Create a new Executor.
#[cfg_attr(
multi_core,
all(multi_core, low_power_wait),
doc = r#"
This will use software-interrupt 3 which isn't available for anything else to wake the other core(s)."#
@ -63,6 +63,9 @@ This will use software-interrupt 3 which isn't available for anything else to wa
pub fn new() -> Self {
Self {
inner: InnerExecutor::new(
// Priority 1 means the timer queue can be accessed at interrupt priority 1 - for
// the thread mode executor it needs to be one higher than the base run level, to
// allow alarm interrupts to be handled.
Priority::Priority1,
(THREAD_MODE_CONTEXT + Cpu::current() as usize) as *mut (),
),
@ -91,6 +94,7 @@ This will use software-interrupt 3 which isn't available for anything else to wa
///
/// This function never returns.
pub fn run(&'static mut self, init: impl FnOnce(Spawner)) -> ! {
#[cfg(all(multi_core, low_power_wait))]
unwrap!(esp_hal::interrupt::enable(
esp_hal::peripherals::Interrupt::FROM_CPU_INTR3,
Priority::min(),