From 0a0d680b488da34ae868c2e90158693ad92ee040 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Sun, 27 Dec 2020 12:00:03 +0100 Subject: [PATCH] Write loop could lead to wdt with low bitrates or large buffers. Fixes #7746 --- cores/esp8266/uart.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/esp8266/uart.cpp b/cores/esp8266/uart.cpp index a21300e51d..47e7243abf 100644 --- a/cores/esp8266/uart.cpp +++ b/cores/esp8266/uart.cpp @@ -506,8 +506,10 @@ uart_write(uart_t* uart, const char* buf, size_t size) size_t ret = size; const int uart_nr = uart->uart_nr; - while (size--) + while (size--) { uart_do_write_char(uart_nr, pgm_read_byte(buf++)); + optimistic_yield(10000UL); + } return ret; }