1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-16 00:43:00 +03:00

Merge pull request #22 from Links2004/esp8266

pull SPI speed fix and uart overflow
This commit is contained in:
ficeto
2015-05-16 12:26:11 +03:00
3 changed files with 25 additions and 19 deletions

View File

@ -392,30 +392,34 @@ void uart_ignore_char(char c) {
void uart0_write_char(char c) {
if(&Serial != NULL && Serial.isTxEnabled()) {
if(c == '\n') {
Serial.write('\r');
if(Serial.availableForWrite() > 0) {
if(c == '\n') {
Serial.write('\r');
}
Serial.write(c);
return;
}
Serial.write(c);
} else {
if(c == '\n') {
USF(0) = '\r';
}
USF(0) = c;
}
if(c == '\n') {
USF(0) = '\r';
}
USF(0) = c;
}
void uart1_write_char(char c) {
if(&Serial1 != NULL && Serial1.isTxEnabled()) {
if(c == '\n') {
Serial1.write('\r');
if(Serial1.availableForWrite() > 0) {
if(c == '\n') {
Serial1.write('\r');
}
Serial1.write(c);
return;
}
Serial1.write(c);
} else {
if(c == '\n') {
USF(1) = '\r';
}
USF(1) = c;
}
if(c == '\n') {
USF(1) = '\r';
}
USF(1) = c;
}
static int s_uart_debug_nr = UART0;