@@ -422,7 +422,7 @@ void uartWrite(uart_t* uart, uint8_t c)
422
422
return ;
423
423
}
424
424
UART_MUTEX_LOCK ();
425
- while (uart -> dev -> status .txfifo_cnt == 0x7F );
425
+ while (uart -> dev -> status .txfifo_cnt >= 0x7E );
426
426
#if CONFIG_IDF_TARGET_ESP32
427
427
uart -> dev -> fifo .rw_byte = c ;
428
428
#else
@@ -441,7 +441,7 @@ void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len)
441
441
uint32_t fifo_reg = UART_FIFO_AHB_REG (uart -> num );
442
442
#endif
443
443
while (len ) {
444
- while (uart -> dev -> status .txfifo_cnt == 0x7F );
444
+ while (uart -> dev -> status .txfifo_cnt >= 0x7E );
445
445
#if CONFIG_IDF_TARGET_ESP32
446
446
uart -> dev -> fifo .rw_byte = * data ++ ;
447
447
#else
@@ -563,7 +563,7 @@ uint32_t uartGetBaudRate(uart_t* uart)
563
563
static void ARDUINO_ISR_ATTR uart0_write_char (char c )
564
564
{
565
565
#if CONFIG_IDF_TARGET_ESP32
566
- while (((ESP_REG (0x01C + DR_REG_UART_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) == 0x7F );
566
+ while (((ESP_REG (0x01C + DR_REG_UART_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) >= 0x7E );
567
567
ESP_REG (DR_REG_UART_BASE ) = c ;
568
568
#else
569
569
while (UART0 .status .txfifo_cnt == 0x7F );
@@ -574,7 +574,7 @@ static void ARDUINO_ISR_ATTR uart0_write_char(char c)
574
574
static void ARDUINO_ISR_ATTR uart1_write_char (char c )
575
575
{
576
576
#if CONFIG_IDF_TARGET_ESP32
577
- while (((ESP_REG (0x01C + DR_REG_UART1_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) == 0x7F );
577
+ while (((ESP_REG (0x01C + DR_REG_UART1_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) >= 0x7E );
578
578
ESP_REG (DR_REG_UART1_BASE ) = c ;
579
579
#else
580
580
while (UART1 .status .txfifo_cnt == 0x7F );
@@ -585,7 +585,7 @@ static void ARDUINO_ISR_ATTR uart1_write_char(char c)
585
585
#if CONFIG_IDF_TARGET_ESP32
586
586
static void ARDUINO_ISR_ATTR uart2_write_char (char c )
587
587
{
588
- while (((ESP_REG (0x01C + DR_REG_UART2_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) == 0x7F );
588
+ while (((ESP_REG (0x01C + DR_REG_UART2_BASE ) >> UART_TXFIFO_CNT_S ) & 0x7F ) >= 0x7E );
589
589
ESP_REG (DR_REG_UART2_BASE ) = c ;
590
590
}
591
591
#endif
0 commit comments