Fix intermittent lockup in echo test

The NRF5x driver transmits a byte by writing it to the uart data
register and then waiting for the TXRDY event indicating that this
byte was sent. If another UART interrupt comes in at the right time
the the UART ISR handler will process and clear the TXRDY event,
even though this interrupt is not enabled. This causes serial_putc
to get stuck waiting on an already cleared TXRDY.

This patch fixing the lockup by preventing the UART ISR from handling
the TXRDY event if this interrupt is not enabled.
pull/2261/head
Russ Butler 2016-07-22 23:30:35 -05:00 committed by Vincent Coubard
parent 1f53752dd1
commit 5206addfd7
1 changed files with 2 additions and 1 deletions

View File

@ -765,7 +765,8 @@ __STATIC_INLINE void uart_irq_handler()
}
}
if (nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_TXDRDY))
if (nrf_uart_int_enable_check(NRF_UART0, NRF_UART_INT_MASK_TXDRDY) &&
nrf_uart_event_check(NRF_UART0, NRF_UART_EVENT_TXDRDY))
{
if (m_cb.tx_counter < (uint16_t) m_cb.tx_buffer_length)
{