Skip to main content

ParkUntilFn

Type Alias ParkUntilFn 

Source
pub type ParkUntilFn = unsafe extern "C" fn(ctx: *mut c_void, deadline_us: u64) -> i8;
Expand description

Park until deadline_us from now, or until something signals, whichever comes first.

Returns 0 when woken by an event, 1 when the deadline expired, and a negative value when this build cannot park at all.

A DEADLINE, not a duration, and that distinction is what makes bare metal work: nros-baremetal-common’s own note says wfi with no pending interrupt deadlocks, so a board must arm a timer compare BEFORE waiting. A sleep(duration) seam cannot express that — the sleeper does not know whether anyone armed an interrupt. park_until(deadline) does, because the deadline is exactly what the compare is armed to.