pub struct SchedTaskExecutorBacking<const N: usize> { /* private fields */ }Expand description
The spawned sched tasks’ executor backing. nros::main! emits one
SchedTaskExecutorBacking static per sched-task entry and hands its slots to the
board’s run_sched_tasks, which refuses a short block through
check_sched_task_executor_backing and opens each spawned sched task with
Executor::open_with_session_slot. Gated like the module it names
(has_rmw + alloc in nros-node).
The spawned sched tasks’ executor backing, N slots in ONE named
static that the ENTRY owns.
nros::main! emits one per sched-task entry, with N = the sched task count minus the
boot sched task (which takes the EXECUTOR_BACKING road), and passes
take to the board’s run_sched_tasks. The board then refuses a
short block with check_sched_task_executor_backing — the Rust twin of the C
library’s nros_cpp_executor_storage_check.
Placement is the caller’s: the static lives in the entry’s
.bss, so mem-report prices it by name.
Implementations§
Source§impl<const N: usize> SchedTaskExecutorBacking<N>
impl<const N: usize> SchedTaskExecutorBacking<N>
Sourcepub const fn new() -> SchedTaskExecutorBacking<N>
pub const fn new() -> SchedTaskExecutorBacking<N>
An untouched reservation. const so it can initialise a static, and
uninitialised (plus a false latch), so the static is all-zero .bss
and costs no flash.
large_stack_arrays is allowed because this is only ever evaluated in
CONST context (a static initialiser): the array is built by the
compiler into .bss, never on a stack.
Sourcepub fn take(&'static self) -> &'static mut [[MaybeUninit<u64>; 11084]]
pub fn take(&'static self) -> &'static mut [[MaybeUninit<u64>; 11084]]
Hand out every slot, once. A second call returns an EMPTY slice, which
the board’s check_sched_task_executor_backing then refuses by name rather
than aliasing a slot another executor is using.
mut_from_ref is the point, not an accident: &'static self is how a
static is reached, and the latch is what makes the one &mut sound —
the same shape as the boot reservation’s take.