From c59e2808e1bf27e8adc7c3aff0d0ed1a8344e04f Mon Sep 17 00:00:00 2001 From: Erik Nyquist Date: Fri, 15 Jul 2016 15:39:16 -0700 Subject: [PATCH] Issue #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. --- cores/arduino/UARTClass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cores/arduino/UARTClass.cpp b/cores/arduino/UARTClass.cpp index 8a74192d..87250d17 100644 --- a/cores/arduino/UARTClass.cpp +++ b/cores/arduino/UARTClass.cpp @@ -112,6 +112,9 @@ void UARTClass::end( void ) opened = false; // Clear any received data _rx_buffer->_iHead = _rx_buffer->_iTail; + + SET_PIN_MODE(17, GPIO_MUX_MODE); // Rdx SOC PIN (Arduino header pin 0) + SET_PIN_MODE(16, GPIO_MUX_MODE); // Txd SOC PIN (Arduino header pin 1) } void UARTClass::setInterruptPriority(uint32_t priority)