發表文章

目前顯示的是 2月, 2018的文章

freeRTOS Task Function

freeRTOS Task Function Each task is a small program in its own right. It has an entry point, will normally run forever within an infinite loop, and will not exit. FreeRTOS tasks must not be allowed to return from their implementing function in any way—they must not contain a ‘return’ statement and must not be allowed to execute past the end of the function. (必需要是無限迴圈) If a task is no longer required, it should instead be explicitly deleted. A single task function definition can be used to create any number of tasks—each created task being a separate execution instance, with its own stack and its own copy of any automatic (stack) variables defined within the task itself. (每個task都有自己的記憶體塊和自己的變數) Function The xTaskCreate() API Function Tasks are created using the FreeRTOS xTaskCreate() API function. BaseType_t xTaskCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTas...