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!?
This commit is contained in:
lbernstone 2021-04-15 03:46:53 -06:00 committed by GitHub
parent e6ba8c7ac9
commit 81b7c47203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,6 +117,7 @@ void HardwareSerial::end()
if(uartGetDebug() == _uart_nr) { if(uartGetDebug() == _uart_nr) {
uartSetDebug(0); uartSetDebug(0);
} }
delay(10);
log_v("pins %d %d",_tx_pin, _rx_pin); log_v("pins %d %d",_tx_pin, _rx_pin);
uartEnd(_uart, _tx_pin, _rx_pin); uartEnd(_uart, _tx_pin, _rx_pin);
_uart = 0; _uart = 0;