Skip to content

Commit 684d70c

Browse files
committed
More frequent optimistic_yield looks safe to me here.
1 parent 14866b2 commit 684d70c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cores/esp8266/uart.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ uart_tx_fifo_full(const int uart_nr)
510510
static void
511511
uart_do_write_char(const int uart_nr, char c)
512512
{
513-
while(uart_tx_fifo_full(uart_nr));
513+
while(uart_tx_fifo_full(uart_nr))
514+
{
515+
optimistic_yield(1000UL);
516+
}
514517

515518
USF(uart_nr) = c;
516519
}
@@ -544,7 +547,6 @@ uart_write(uart_t* uart, const char* buf, size_t size)
544547
const int uart_nr = uart->uart_nr;
545548
while (size--) {
546549
uart_do_write_char(uart_nr, pgm_read_byte(buf++));
547-
optimistic_yield(10000UL);
548550
}
549551

550552
return ret;

libraries/ESP8266WiFi/src/WiFiUdp.cpp

Lines changed: 1 addition & 1 deletion
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)