From 81b7c47203b7558cc634ab2b22f966aa4bbc9ce1 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Thu, 15 Apr 2021 03:46:53 -0600 Subject: [PATCH] Serial::end hang (#5047) workaround for #5043. There is a timing issue with HardwareSerial::end. I'm not sure what is hung, but it should be possible to see this in jtag, as it does cause a reboot if you let it. The delay needs to be before you detach the device!? --- cores/esp32/HardwareSerial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 9e6a675c..7eb75354 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -117,6 +117,7 @@ void HardwareSerial::end() if(uartGetDebug() == _uart_nr) { uartSetDebug(0); } + delay(10); log_v("pins %d %d",_tx_pin, _rx_pin); uartEnd(_uart, _tx_pin, _rx_pin); _uart = 0;