1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

improve os_printf handling when buffer full.

- wait for free buffer in hw fifo
This commit is contained in:
Markus Sattler 2015-05-17 13:43:49 +02:00
parent e0f9a4173e
commit 5b5deb5a77

View File

@ -400,6 +400,14 @@ void uart0_write_char(char c) {
return;
}
}
// wait for the Hardware FIFO
while(true) {
if(((USS(0) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) {
break;
}
}
if(c == '\n') {
USF(0) = '\r';
}
@ -416,6 +424,14 @@ void uart1_write_char(char c) {
return;
}
}
// wait for the Hardware FIFO
while(true) {
if(((USS(1) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) {
break;
}
}
if(c == '\n') {
USF(1) = '\r';
}