From 84260dcb44dea9a5c73762ac018e46e400c30edf Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" <19971886+dok-net@users.noreply.github.com> Date: Thu, 31 Dec 2020 01:05:20 +0100 Subject: [PATCH] Write loop could lead to wdt with low bitrates or large buffers. Fixes #7746 (#7799) --- 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 a21300e51..47e7243ab 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; }