We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03f5d62 commit fb4f133Copy full SHA for fb4f133
cores/esp32/esp32-hal-uart.c
@@ -170,9 +170,11 @@ void uartWrite(uart_t* uart, uint8_t c)
170
171
void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len)
172
{
173
- while(len && uart->dev->status.rxfifo_cnt < 0x7F) {
174
- uart->dev->fifo.rw_byte = *data++;
175
- len--;
+ while(len) {
+ while(len && uart->dev->status.txfifo_cnt < 0x7F) {
+ uart->dev->fifo.rw_byte = *data++;
176
+ len--;
177
+ }
178
}
179
180
@@ -189,8 +191,8 @@ void uartFlush(uart_t* uart)
189
191
190
192
193
if(uart->txEnabled) {
- tmp |= UART_TXFIFO_RST;
194
while(uart->dev->status.txfifo_cnt);
195
+ tmp |= UART_TXFIFO_RST;
196
197
198
uart->dev->conf0.val |= (tmp);
0 commit comments