This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI-RTOS的PRIORITY问题

Other Parts Discussed in Thread: BLE-STACK

TI-RTOS操作系统中的优先级(PRIORITY)是如何Set或使用的?

抢占式还是时间片。

谢谢!

  • 抢占式。

    The TI-RTOS Kernel (SYS/BIOS) is a PRE-EMPTIVE scheduler. This means the
    highest priority thread ALWAYS RUNS FIRST. Time-slicing is not inherently
    supported (can change PRI dynamically if desired).

  • 任务优先级的设置可以参考BLE-STACK里的任务创建

    void SimpleBLEPeripheral_createTask(void)
    {
      Task_Params taskParams;
     
      // Configure task
      Task_Params_init(&taskParams);
      taskParams.stack = sbpTaskStack;
      taskParams.stackSize = SBP_TASK_STACK_SIZE;
      taskParams.priority = SBP_TASK_PRIORITY;
     
      Task_construct(&sbpTask, SimpleBLEPeripheral_taskFxn, &taskParams, NULL);
    }