Function esp_idf_sys::xTaskCreatePinnedToCore
source · pub unsafe extern "C" fn xTaskCreatePinnedToCore(
pxTaskCode: TaskFunction_t,
pcName: *const c_char,
ulStackDepth: u32,
pvParameters: *mut c_void,
uxPriority: UBaseType_t,
pxCreatedTask: *mut TaskHandle_t,
xCoreID: BaseType_t,
) -> BaseType_t
Expand description
@brief Create a new task that is pinned to a particular core
This function is similar to xTaskCreate(), but allows the creation of a pinned task. The task’s pinned core is specified by the xCoreID argument. If xCoreID is set to tskNO_AFFINITY, then the task is unpinned and can run on any core.
@note If ( configNUMBER_OF_CORES == 1 ), setting xCoreID to tskNO_AFFINITY will be be treated as 0.
@param pxTaskCode Pointer to the task entry function. @param pcName A descriptive name for the task. @param ulStackDepth The size of the task stack specified as the NUMBER OF BYTES. Note that this differs from vanilla FreeRTOS. @param pvParameters Pointer that will be used as the parameter for the task being created. @param uxPriority The priority at which the task should run. @param pxCreatedTask Used to pass back a handle by which the created task can be referenced. @param xCoreID The core to which the task is pinned to, or tskNO_AFFINITY if the task has no core affinity. @return pdPASS if the task was successfully created and added to a ready list, otherwise an error code defined in the file projdefs.h