Function esp_idf_svc::hal::task::create
source · pub unsafe fn create(
task_handler: extern "C" fn(_: *mut c_void),
task_name: &CStr,
stack_size: usize,
task_arg: *mut c_void,
priority: u8,
pin_to_core: Option<Core>,
) -> Result<*mut tskTaskControlBlock, EspError>
Expand description
Creates a FreeRTOS task.
This API is to be used only for niche use cases like where the std
feature is not enabled, or one absolutely
needs to create a raw FreeRTOS task.
In all other cases, the standard, safe Rust std::thread
API should be utilized, as it is anyway
a thin wrapper around the FreeRTOS task API.
§Safety
Only marked as unsafe fo symmetry with destroy
and to discourage users from leaning on it in favor of std::thread
.
Otherwise, this function is actually safe.