新手入门
- 积分
- 18
- 金钱
- 18
- 注册时间
- 2018-5-14
- 在线时间
- 1 小时
|
1金钱
int main(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);//éèÖÃÏμí3ÖD¶ÏóÅÏ輶·Ö×é4
delay_init(); //Ñóê±oˉêy3õê¼»ˉ
uart_init(115200); //3õê¼»ˉ′®¿ú
LED_Init(); //3õê¼»ˉLED
//′′½¨èy¸öèÎÎñ
xTaskCreate((TaskFunction_t )start_task1, //èÎÎñoˉêy
(const char* )"start_task1", //èÎÎñÃû3Æ
(uint16_t )TASK1_SIZE, //èÎÎñ¶ÑÕ»′óD¡
(void* )NULL, //′«μY¸øèÎÎñoˉêyμÄ2Îêy
(UBaseType_t )TASK1_PRIO, //èÎÎñóÅÏ輶
(TaskHandle_t* )&TASK1_Handler); //èÎÎñ¾ä±ú
xTaskCreate((TaskFunction_t )start_task2, //èÎÎñoˉêy
(const char* )"start_task2", //èÎÎñÃû3Æ
(uint16_t )TASK2_SIZE, //èÎÎñ¶ÑÕ»′óD¡
(void* )NULL, //′«μY¸øèÎÎñoˉêyμÄ2Îêy
(UBaseType_t )TASK2_PRIO, //èÎÎñóÅÏ輶
(TaskHandle_t* )&TASK2_Handler); //èÎÎñ¾ä±ú
xTaskCreate((TaskFunction_t )start_task3, //èÎÎñoˉêy
(const char* )"start_task3", //èÎÎñÃû3Æ
(uint16_t )TASK3_SIZE, //èÎÎñ¶ÑÕ»′óD¡
(void* )NULL, //′«μY¸øèÎÎñoˉêyμÄ2Îêy
(UBaseType_t )TASK3_PRIO, //èÎÎñóÅÏ輶
(TaskHandle_t* )&TASK3_Handler); //èÎÎñ¾ä±ú
vTaskStartScheduler(); //¿aÆôèÎÎñμ÷¶è
}
请问,开启任务调度器后, vTaskStartScheduler(); ,难道在这三个任务中,不应该是按任务优先级顺序,依次执行吗?
为什么事实不是这样?
|
|