diff --git a/embassy-nrf-examples/src/bin/multiprio.rs b/embassy-nrf-examples/src/bin/multiprio.rs index f5ebf67f..65c64621 100644 --- a/embassy-nrf-examples/src/bin/multiprio.rs +++ b/embassy-nrf-examples/src/bin/multiprio.rs @@ -67,7 +67,7 @@ use cortex_m_rt::entry; use defmt::panic; use nrf52840_hal::clocks; -use embassy::executor::{task, Executor, IrqExecutor}; +use embassy::executor::{task, Executor, InterruptExecutor}; use embassy::interrupt::InterruptExt; use embassy::time::{Duration, Instant, Timer}; use embassy::util::Forever; @@ -117,9 +117,9 @@ async fn run_low() { static RTC: Forever> = Forever::new(); static ALARM_HIGH: Forever> = Forever::new(); -static EXECUTOR_HIGH: Forever> = Forever::new(); +static EXECUTOR_HIGH: Forever> = Forever::new(); static ALARM_MED: Forever> = Forever::new(); -static EXECUTOR_MED: Forever> = Forever::new(); +static EXECUTOR_MED: Forever> = Forever::new(); static ALARM_LOW: Forever> = Forever::new(); static EXECUTOR_LOW: Forever = Forever::new(); @@ -142,7 +142,7 @@ fn main() -> ! { let irq = interrupt::take!(SWI1_EGU1); irq.set_priority(interrupt::Priority::Level6); let alarm = ALARM_HIGH.put(rtc.alarm2()); - let executor = EXECUTOR_HIGH.put(IrqExecutor::new(irq)); + let executor = EXECUTOR_HIGH.put(InterruptExecutor::new(irq)); executor.set_alarm(alarm); executor.start(|spawner| { unwrap!(spawner.spawn(run_high())); @@ -152,7 +152,7 @@ fn main() -> ! { let irq = interrupt::take!(SWI0_EGU0); irq.set_priority(interrupt::Priority::Level7); let alarm = ALARM_MED.put(rtc.alarm1()); - let executor = EXECUTOR_MED.put(IrqExecutor::new(irq)); + let executor = EXECUTOR_MED.put(InterruptExecutor::new(irq)); executor.set_alarm(alarm); executor.start(|spawner| { unwrap!(spawner.spawn(run_med())); diff --git a/embassy/src/executor/mod.rs b/embassy/src/executor/mod.rs index 787230c0..10e54330 100644 --- a/embassy/src/executor/mod.rs +++ b/embassy/src/executor/mod.rs @@ -215,13 +215,13 @@ fn pend_by_number(n: u16) { cortex_m::peripheral::NVIC::pend(N(n)) } -pub struct IrqExecutor { +pub struct InterruptExecutor { irq: I, inner: raw::Executor, not_send: PhantomData<*mut ()>, } -impl IrqExecutor { +impl InterruptExecutor { pub fn new(irq: I) -> Self { let ctx = irq.number() as *mut (); Self {