11.6_1:解决了中断消息队列无法正常接收串口中断的bug,初步实现中断消息队列。

This commit is contained in:
2025-11-06 21:25:30 +08:00
parent 5f408b4ece
commit 3e3e96e017
7 changed files with 104 additions and 71 deletions

View File

@@ -128,12 +128,11 @@ void USART3_IRQHandler(void)
if (USART_GetITStatus(USART3, USART_IT_RXNE) == SET)
{
/* code */
uint32_t ulRxData = USART_ReceiveData(USART3);
while (ulRxData != 0xFF)
{
/* code */
ucRxBuffer[ucIndex++] = ulRxData;
}
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
uint8_t ulRxData = (uint8_t)USART_ReceiveData(USART3);
xQueueSendFromISR(xQueueUsart3ReHdlr, &ulRxData, &xHigherPriorityTaskWoken);
USART_ClearITPendingBit(USART3, USART_IT_RXNE);
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD> */
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
}