Skip to content

Commit

Permalink
Revert problematic changes that will crash in ELRS LUA for PR EdgeTX#…
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Apr 17, 2023
1 parent 95cfe47 commit ab25a90
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions radio/src/targets/common/arm/stm32/stm32_usart_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,14 @@ void stm32_usart_isr(const stm32_usart_t* usart, etx_serial_callbacks_t* cb)
// Drain RX
while (status & (LL_USART_SR_RXNE | USART_FLAG_ERRORS)) {

// This will clear the RXNE bit in USART_DR register
uint8_t data = LL_USART_ReadReg(usart->USARTx, DR);

if (status & USART_FLAG_ERRORS) {
if (cb->on_error)
cb->on_error();
}

if (status & LL_USART_SR_RXNE) {
// This will clear the RXNE bit in USART_DR register
uint8_t data = LL_USART_ReadReg(usart->USARTx, DR);

else {
if (cb->on_receive)
cb->on_receive(data);
}
Expand Down

0 comments on commit ab25a90

Please sign in to comment.