FreeRTOS 任务管理之任务创建
任务概念
任务:个人感觉就是将相关的一系列操作放在一个任务函数里来,跟线程差不多一个概念。
任务创建
在FreeRTOS中,任务创建是由任务创建函数来执行,任务创建函数原型如下:
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
BaseType_t xTaskGenericCreate( TaskFunction_t pxTaskCode,
const char * const pcName,
const uint16_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask,
StackType_t * const puxStackBuffer,
const MemoryRegion_t * const xRegions );
我们平时调用的是xTaskCreate(