1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Added idle interrupt callback to UART driver

This commit is contained in:
Miguel.Alvarez 2019-07-22 15:55:49 -05:00
parent 0f230c42a1
commit 38013a8253
7 changed files with 49 additions and 8 deletions

View file

@ -289,9 +289,18 @@ void uartIrqHandler(uartPort_t *s)
}
}
if (USART_GetITStatus(s->USARTx, USART_IT_ORE) == SET)
{
USART_ClearITPendingBit (s->USARTx, USART_IT_ORE);
if (USART_GetITStatus(s->USARTx, USART_IT_ORE) == SET) {
USART_ClearITPendingBit(s->USARTx, USART_IT_ORE);
}
if (USART_GetITStatus(s->USARTx, USART_IT_IDLE) == SET) {
if (s->port.idleCallback) {
s->port.idleCallback();
}
// clear
(void) s->USARTx->SR;
(void) s->USARTx->DR;
}
}
#endif