mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-10 14:42:08 +03:00
improve os_printf handling when buffer full.
- wait for free buffer in hw fifo
This commit is contained in:
parent
e0f9a4173e
commit
5b5deb5a77
@ -400,6 +400,14 @@ void uart0_write_char(char c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for the Hardware FIFO
|
||||||
|
while(true) {
|
||||||
|
if(((USS(0) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(c == '\n') {
|
if(c == '\n') {
|
||||||
USF(0) = '\r';
|
USF(0) = '\r';
|
||||||
}
|
}
|
||||||
@ -416,6 +424,14 @@ void uart1_write_char(char c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for the Hardware FIFO
|
||||||
|
while(true) {
|
||||||
|
if(((USS(1) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(c == '\n') {
|
if(c == '\n') {
|
||||||
USF(1) = '\r';
|
USF(1) = '\r';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user