AnsweredAssumed Answered

how to add a task in freertos

Question asked by yuan xiao on Jul 19, 2018
Latest reply on Jul 21, 2018 by Daniel Chen

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!

Outcomes