Skip to content

Commit c59e280

Browse files
committed
Issue arduino#241: make Serial1 release GPIO pins on end()
UARTClass::init() muxes out the UART pins to Arduino header pins 0/1. Reset the mux on UARTClass::end() so that pins 0/1 can be used as GPIOs again.
1 parent bdaec19 commit c59e280

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: cores/arduino/UARTClass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ void UARTClass::end( void )
112112
opened = false;
113113
// Clear any received data
114114
_rx_buffer->_iHead = _rx_buffer->_iTail;
115+
116+
SET_PIN_MODE(17, GPIO_MUX_MODE); // Rdx SOC PIN (Arduino header pin 0)
117+
SET_PIN_MODE(16, GPIO_MUX_MODE); // Txd SOC PIN (Arduino header pin 1)
115118
}
116119

117120
void UARTClass::setInterruptPriority(uint32_t priority)

0 commit comments

Comments
 (0)