11#ifndef FREERTOS_TASK_H
12#define FREERTOS_TASK_H
19#include "freertos/FreeRTOS.h"
25#define xTaskHandle TaskHandle_t
26#define tskNO_AFFINITY INT_MAX
28#define taskDISABLE_INTERRUPTS portDISABLE_INTERRUPTS
29#define taskENABLE_INTERRUPTS portENABLE_INTERRUPTS
31#define taskENTER_CRITICAL portENTER_CRITICAL
32#define taskEXIT_CRITICAL portEXIT_CRITICAL
34#define taskSCHEDULER_NOT_STARTED 1
35#define taskSCHEDULER_RUNNING 2
41 eSetValueWithOverwrite,
42 eSetValueWithoutOverwrite,
45typedef void (*TaskFunction_t)(
void *);
46typedef void (*TlsDeleteCallbackFunction_t)( int,
void * );
48typedef void* TaskHandle_t;
50BaseType_t xTaskCreate(TaskFunction_t pvTaskCode,
51 const char *
const pcName,
52 const uint32_t usStackDepth,
53 void *
const pvParameters,
54 UBaseType_t uxPriority,
55 TaskHandle_t *
const pvCreatedTask);
57BaseType_t xTaskCreatePinnedToCore(TaskFunction_t pvTaskCode,
58 const char *
const pcName,
59 const uint32_t usStackDepth,
60 void *
const pvParameters,
61 UBaseType_t uxPriority,
62 TaskHandle_t *
const pvCreatedTask,
63 const BaseType_t xCoreID);
65void vTaskDelete(TaskHandle_t xTaskToDelete);
66void vTaskSuspend(TaskHandle_t xTaskToSuspend);
67void vTaskResume(TaskHandle_t xTaskToResume);
68void vTaskDelay(
const TickType_t xTicksToDelay);
69void vTaskSuspendAll(
void);
71TaskHandle_t xTaskGetCurrentTaskHandle(
void);
73const char *pcTaskGetTaskName(TaskHandle_t xTaskToQuery);
75UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask);
77void *pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery,
79void vTaskSetThreadLocalStoragePointerAndDelCallback(TaskHandle_t xTaskToSet,
82 TlsDeleteCallbackFunction_t pvDelCallback);
84void vTaskEnterCritical(portMUX_TYPE *mux);
85void vTaskExitCritical(portMUX_TYPE *mux);
87TickType_t xTaskGetTickCount(
void);
89BaseType_t xTaskNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue,
90 eNotifyAction eAction);
91BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry,
92 uint32_t ulBitsToClearOnExit,
93 uint32_t *pulNotificationValue,
94 TickType_t xTicksToWait);
96BaseType_t xTaskNotifyGive(TaskHandle_t xTaskToNotify);
97void vTaskNotifyGiveFromISR(TaskHandle_t xTaskToNotify,
98 BaseType_t *pxHigherPriorityTaskWoken);
99uint32_t ulTaskNotifyTake(BaseType_t xClearCountOnExit,
100 TickType_t xTicksToWait);