pub fn start_with_idle_hook(
timer: impl TimerSource,
int0: SoftwareInterrupt<'static, 0>,
idle_hook: extern "C" fn() -> !,
)Expand description
Starts the scheduler, with a custom idle hook.
The current context will be converted into the main task, and will be pinned to the first core.
The idle hook will be called when no tasks are ready to run. The idle hook’s context is not preserved. If you need to execute a longer process to enter a low-power state, make sure to call the relevant code in a critical section.
The timer argument is a timer source that is used by the scheduler to
schedule internal tasks. The timer source can be any of the following:
- A timg
Timerinstance - A systimer
Alarminstance - An
AnyTimerinstance - A
OneShotTimerinstance
The int0 argument must be SoftwareInterrupt<0> which will be used to trigger context switches.
For an example, see the crate-level documentation.