(1)朱工在FreeRTOS高级篇2---FreeRTOS任务创建分析说到:
- BaseType_t xTaskCreate(
- TaskFunction_tp vTaskCode,
- const charchar * constpcName,
- unsigned short usStackDepth,
- voidvoid *pvParameters,
- UBaseType_t uxPriority,
- TaskHandle_t *pvCreatedTask
- );
- usStackDepth:指定任务堆栈大小,能够支持的堆栈变量数量(堆栈深度),而不是字节数。比如,在16位宽度的堆栈下,usStackDepth定义为100,则实际使用200字节堆栈存储空间。堆栈的宽度乘以深度必须不超过size_t类型所能表示的最大值。比如,size_t为16位,则可以表示堆栈的最大值是65535字节。这是因为堆栈在申请时是以字节为单位的,申请的字节数就是堆栈宽度乘以深度,如果这个乘积超出size_t所表示的范围,就会溢出,分配的堆栈空间也不是我们想要的。
但我现在用的是V9.0.0版本了,函数式这样的:
BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
const char * const pcName,
const uint16_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask )
函数内部有:
对于STM32