Task Priorities Question

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Task Priorities Question

    All of the MainTask() task functions of embOS/IP example applications are structured like this...

    C Source Code

    1. void MainTask(void) {
    2. IP_Init();
    3. OS_SetPriority(OS_GetTaskID(), 255); // This task has highest prio!
    4. OS_CREATETASK(&_TCB, "IP_Task", IP_Task, 150, _Stack);
    5. #if USE_RX_TASK
    6. OS_CREATETASK(&_IPRxTCB, "IP_RxTask", IP_RxTask, 140, _IPRxStack); // Start the IP_RxTask, optional.
    7. #endif
    8. while (IP_IFaceIsReady() == 0) {
    9. OS_Delay(50);
    10. }
    11. //
    12. // Start ... task if interface ready.
    13. //
    14. OS_CREATETASK_EX(...);
    15. while (1) {
    16. BSP_ToggleLED(1);
    17. OS_Delay (200);
    18. }
    19. }
    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)?