Fixes UART pin detach on Serial.end() #7402
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
When
Serial.end()
is executed, the UART driver doesn't detach RX/TX/CTS/RTS pins.As consequense, those pins pads connected using IOMUX by IDF layer will continue to send/receive data to/from the peripheral, causing the impression that Serial is still working.
This PR fixes it by adding a pin detach function used in
Serial.end()
.Tests scenarios
Tested using ESP32 and ESP32C3.
Necessary to use Arduino Serial Monitor for the default Board Serial port (Serial) and then some other UART<->USB converter board for reading the messages from pin 5 (new TX).
Related links
Fixes #7359