Function esp_idf_svc::sys::xTaskCreateStaticPinnedToCore

source ·
pub unsafe extern "C" fn xTaskCreateStaticPinnedToCore(
    pxTaskCode: Option<unsafe extern "C" fn(_: *mut c_void)>,
    pcName: *const i8,
    ulStackDepth: u32,
    pvParameters: *mut c_void,
    uxPriority: u32,
    puxStackBuffer: *mut u8,
    pxTaskBuffer: *mut xSTATIC_TCB,
    xCoreID: i32,
) -> *mut tskTaskControlBlock
Expand description

@brief Create a new static task that is pinned to a particular core

This function is similar to xTaskCreateStatic(), 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 puxStackBuffer Must point to a StackType_t array that has at least ulStackDepth indexes @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will then be used to hold the task’s data structures, @param xCoreID The core to which the task is pinned to, or tskNO_AFFINITY if the task has no core affinity. @return The task handle if the task was created, NULL otherwise.