Skip to content

Commit e72291a

Browse files
Earle F. Philhower, IIIEarle F. Philhower, III
authored andcommitted
Also set the UART flags for HW error in GDB
Ensure we also check the UART flags and set the uart status appropriately when in GDB mode.
1 parent 33a21cd commit e72291a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cores/esp8266/uart.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,17 @@ static void ICACHE_RAM_ATTR uart_isr_handle_data(void* arg, uint8_t data)
307307
}
308308
rx_buffer->buffer[rx_buffer->wpos] = data;
309309
rx_buffer->wpos = nextPos;
310+
311+
// Check the UART flags and note hardware overflow/etc.
312+
uint32_t usis = USIS(uart->uart_nr);
313+
314+
if(usis & (1 << UIOF))
315+
uart->rx_overrun = true;
316+
317+
if (usis & ((1 << UIFR) | (1 << UIPE) | (1 << UITO)))
318+
uart->rx_error = true;
319+
320+
USIC(uart->uart_nr) = usis;
310321
}
311322

312323
size_t
@@ -362,7 +373,7 @@ uart_isr(void * arg)
362373
if(usis & (1 << UIFF))
363374
uart_rx_copy_fifo_to_buffer_unsafe(uart);
364375

365-
if((usis & (1 << UIOF)) && !uart->rx_overrun)
376+
if(usis & (1 << UIOF))
366377
{
367378
uart->rx_overrun = true;
368379
//os_printf_plus(overrun_str);

0 commit comments

Comments
 (0)