mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
fix bug when TX buffer is full and os will write.
in this case we hang endless or until wtd triggers. new: now we overdrive the data in FIFO --> no hang / crash but we loss chars. only happens by extensive use of os_printf!
This commit is contained in:
parent
4644c3bad0
commit
b4a8bb0653
@ -392,31 +392,35 @@ void uart_ignore_char(char c) {
|
||||
|
||||
void uart0_write_char(char c) {
|
||||
if(&Serial != NULL && Serial.isTxEnabled()) {
|
||||
if(Serial.availableForWrite() > 0) {
|
||||
if(c == '\n') {
|
||||
Serial.write('\r');
|
||||
}
|
||||
Serial.write(c);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(c == '\n') {
|
||||
USF(0) = '\r';
|
||||
}
|
||||
USF(0) = c;
|
||||
}
|
||||
}
|
||||
|
||||
void uart1_write_char(char c) {
|
||||
if(&Serial1 != NULL && Serial1.isTxEnabled()) {
|
||||
if(Serial1.availableForWrite() > 0) {
|
||||
if(c == '\n') {
|
||||
Serial1.write('\r');
|
||||
}
|
||||
Serial1.write(c);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(c == '\n') {
|
||||
USF(1) = '\r';
|
||||
}
|
||||
USF(1) = c;
|
||||
}
|
||||
}
|
||||
|
||||
static int s_uart_debug_nr = UART0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user