我正在使用ARM Cortex-M4微控制器与FreeRTOS开发应用程序。FreeRTOS任务不恢复
对于确切的时间,我想使用基于中断的定时器。中断具有适当的优先级,所以它应该能够调用FreeRTOS API。该ISR定期调用并且应该唤醒一个任务,在给定的代码:正确执行
/* This function is executed by the task I'd like to resume */
void hello_task() {
while (1) {
vTaskSuspend(task);
printf("Tick\n");
}
}
/* The ISR is called by an interrupt about 200 times per second */
void Timer_IRQHandler() {
CLEAR_INTERRUPT_FLAG();
xTaskResumeFromISR(task);
}
的ISR但任务并不事后恢复。 有没有人有这种行为的解释?
谢谢!
该文档说'xTaskResumeFromISR'实际上不会直接执行上下文切换,但需要在ISR末端使用portYIELD_FROM_ISR()才能实现。 – tofro
就我所见,[link](http://www.freertos.org/taskresumefromisr.html)中的示例仅在xTaskResumeFromISR返回pdTRUE时产生。在我的情况下,返回pdFALSE,因此这不应该是问题。 – eeucalyptus
那么,这可能是问题 - 我想你*想要它产生*? – tofro