start_second_core_with_stack_guard_offset

Function start_second_core_with_stack_guard_offset 

Source
pub fn start_second_core_with_stack_guard_offset<const STACK_SIZE: usize>(
    cpu_control: CPU_CTRL<'_>,
    int1: SoftwareInterrupt<'static, 1>,
    stack: &'static mut Stack<STACK_SIZE>,
    stack_guard_offset: Option<usize>,
    func: impl FnOnce() + Send + 'static,
)
Available on multi_core only.
Expand description

Starts the scheduler on the second CPU core.

Note that the scheduler must be started first, before starting the second core.

The supplied stack and function will be used as the main thread of the second core. The thread will be pinned to the second core.

The stack guard offset is used to reserve a portion of the stack for the stack guard, for safety purposes. Passing None will result in the default value configured by the ESP_HAL_CONFIG_STACK_GUARD_OFFSET esp-hal configuration.

You can return from the second core’s main thread function. This will cause the scheduler to enter the idle state, but the second core will continue to run interrupt handlers and other tasks.