每个任务会分配一个从0到(configMAX_PRIORITIES-1)的优先级,configMAX_PRIORITIES在FreeRTOSConfig.h中定义。
If the port in use implements a port optimised task selection mechanism that uses a ‘count leading zeros’ type instruction (for task selection in a single instruction) and configUSE_PORT_OPTIMISED_TASK_SELECTION is set to 1 in FreeRTOSConfig.h, then configMAX_PRIORITIES cannot be higher than 32. In all other cases configMAX_PRIORITIES can take any value within reason – but for reasons of RAM usage efficiency should be kept to the minimum value actually necessary. (没有看懂)
低优先级数字代表低优先级任务,空闲任务的优先级为0(tskIDLE_PRIORITY)。
任意数量的任务可以共享一个优先级。如果没有定义configUSE_TIME_SLICING,或者configUSE_TIME_SLICING定义为1,那么处于就绪态的同优先级任务将使用时间片循环调度方案来共享可用的处理器时间。