pub struct InterruptExecutor<const SWI: u8> { /* private fields */ }
Expand description
Interrupt mode executor.
This executor runs tasks in interrupt mode. The interrupt handler is set up to poll tasks, and when a task is woken the interrupt is pended from software.
Implementations§
Source§impl<const SWI: u8> InterruptExecutor<SWI>
impl<const SWI: u8> InterruptExecutor<SWI>
Sourcepub const fn new(interrupt: SoftwareInterrupt<SWI>) -> Self
pub const fn new(interrupt: SoftwareInterrupt<SWI>) -> Self
Create a new InterruptExecutor
.
This takes the software interrupt to be used internally.
Sourcepub fn start(&'static mut self, priority: Priority) -> SendSpawner
pub fn start(&'static mut self, priority: Priority) -> SendSpawner
Start the executor at the given priority level.
This initializes the executor, enables the interrupt, and returns. The executor keeps running in the background through the interrupt.
This returns a SendSpawner
you can use to spawn tasks on it. A
SendSpawner
is returned instead of a
Spawner
because the
executor effectively runs in a different “thread” (the interrupt),
so spawning tasks on it is effectively sending them.
To obtain a Spawner
for this executor,
use Spawner::for_current_executor
from a task running in it.
Sourcepub fn spawner(&'static self) -> SendSpawner
pub fn spawner(&'static self) -> SendSpawner
Get a SendSpawner for this executor
This returns a SendSpawner
you can use to spawn tasks on this
executor.
This MUST only be called on an executor that has already been started. The function will panic otherwise.