10000 More frequent optimistic_yield looks safe to me here. · dok-net/arduino-esp8266@3cb53ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cb53ba

Browse files
committed
More frequent optimistic_yield looks safe to me here.
1 parent 671a967 commit 3cb53ba

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
@@ -194,7 +194,7 @@ int WiFiUDP::parsePacket()
194194
return 0;
195195

196196
if (!_ctx->next()) {
197-
optimistic_yield(10000);
197+
optimistic_yield(1000);
198198
return 0;
199199
}
200200

0 commit comments

Comments
 (0)
0