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:
parent
0f230c42a1
commit
38013a8253
7 changed files with 49 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue