Skip to content

Commit a9ce5e9

Browse files
committed
More frequent optimistic_yield looks safe to me here.
1 parent 1111d26 commit a9ce5e9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cores/esp8266/uart.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ uart_tx_fifo_full(const int uart_nr)
509509
static void
510510
uart_do_write_char(const int uart_nr, char c)
511511
{
512-
while(uart_tx_fifo_full(uart_nr));
512+
while(uart_tx_fifo_full(uart_nr))
513+
{
514+
optimistic_yield(1000UL);
515+
}
513516

514517
USF(uart_nr) = c;
515518
}
@@ -543,7 +546,6 @@ uart_write(uart_t* uart, const char* buf, size_t size)
543546
const int uart_nr = uart->uart_nr;
544547
while (size--) {
545548
uart_do_write_char(uart_nr, pgm_read_byte(buf++));
546-
optimistic_yield(10000UL);
547549
}
548550

549551
return ret;

libraries/ESP8266WiFi/src/WiFiUdp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int WiFiUDP::parsePacket()
195195
return 0;
196196

197197
if (!_ctx->next()) {
198-
optimistic_yield(10000);
198+
optimistic_yield(1000);
199199
return 0;
200200
}
201201

0 commit comments

Comments
 (0)