中断函数中xEventGroupSetBitsFromISR执行成功的,也成功执行了portYIELD_FROM_ISR,可是在KeyRead中,xEventGroupWaitBits却一直无法等到。请高人指点一下,代码附下。
void KeyRead(void *p)
{
for(;;)
{
while(1 == xEventGroupWaitBits(EventGroupHandle,Ev_key,pdFALSE,pdFALSE,100))
{
xEventGroupSetBits(EventGroupHandle,Ev_LED);
xEventGroupClearBits(EventGroupHandle,Ev_key);
}
osDelay(100);
}
}
void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
{
BaseType_t result = pdTRUE,xHigherPriorityTaskWoken;
if(KEY_Pin == GPIO_Pin)
{
result = xEventGroupSetBitsFromISR(EventGroupHandle,Ev_key,&xHigherPriorityTaskWoken);
if(pdFAIL != result)
{
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
//xEventGroupSetBits(EventGroupHandle,Ev_key);
}
__HAL_GPIO_EXTI_CLEAR_FALLING_IT(KEY_Pin);
} |