Skip to content

Commit

Permalink
Write loop could lead to wdt with low bitrates or large buffers. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Dec 29, 2020
1 parent a3a7a23 commit 0a0d680
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cores/esp8266/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0a0d680

Please sign in to comment.