Skip to content

Commit

Permalink
Don't enable the interrupt when waiti isn't used
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Feb 7, 2025
1 parent 235ee62 commit 48dff29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion esp-hal-embassy/src/executor/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@ 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)."#
)]
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 (),
),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 48dff29

Please sign in to comment.