how to add a task in freertos

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to add a task in freertos

2,681 次查看
xiaolongyuan
Contributor II

i use the board frdm-kw36z i find the  freertos file fsl_os_abstraction_free_rtos.c this is the main function entrance as belows excerpt 

int main (void)
{
/* Initialize MCU clock */
hardware_init();
OSA_TaskCreate(OSA_TASK(startup_task), NULL);

vTaskStartScheduler();
return 0;
}

if i want to create another self define task how to add and make it works ,do i need to write  a similary  function 

OSA_TaskCreate(OSA_TASK(my_task), NULL);

and give some definition like this 

#ifndef gMainThreadStackSize_c
#define gMainThreadStackSize_c 1024
#endif
#ifndef gMainThreadPriority_c
#define gMainThreadPriority_c 7
#endif

than write a thread func in the realization of my_task. is it that right ,or some one give tips or demo on how to add a self define task.. thanks a lot!

标签 (1)
0 项奖励
回复
1 回复

2,494 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi yuan:

xTaskCreate is an API to create a new task and add it to the list of tasks that are ready to run.

Please refer to below link and hello world demo for more details

This page describes the RTOS xTaskCreate() FreeRTOS API function which is part of the RTOS task cont... 

pastedImage_1.png

OSA_TaskCreate is a wrapper, it is also right to create a new task.

Regards

Daniel

0 项奖励
回复