All of the MainTask() task functions of embOS/IP example applications are structured like this...
Display All
In the embOS/IP manual UM07001 on p. 64 the note for IP_Task() reads "The priority of task IP_Task should be higher then the priority of an application
task which uses the stack." I understand that, but why does the code above appear to be setting the priority of MainTask() to maximum (higher than IP_Task)?
C Source Code
- void MainTask(void) {
- IP_Init();
- OS_SetPriority(OS_GetTaskID(), 255); // This task has highest prio!
- OS_CREATETASK(&_TCB, "IP_Task", IP_Task, 150, _Stack);
- #if USE_RX_TASK
- OS_CREATETASK(&_IPRxTCB, "IP_RxTask", IP_RxTask, 140, _IPRxStack); // Start the IP_RxTask, optional.
- #endif
- while (IP_IFaceIsReady() == 0) {
- OS_Delay(50);
- }
- //
- // Start ... task if interface ready.
- //
- OS_CREATETASK_EX(...);
- while (1) {
- BSP_ToggleLED(1);
- OS_Delay (200);
- }
- }
In the embOS/IP manual UM07001 on p. 64 the note for IP_Task() reads "The priority of task IP_Task should be higher then the priority of an application
task which uses the stack." I understand that, but why does the code above appear to be setting the priority of MainTask() to maximum (higher than IP_Task)?