You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running the UART (Serial1) port for a length of time, then turning it off and trying to use it as an output, but this fails silently. I expect to be able to set the mode to OUTPUT and write values to it after Serial1.end() has been called.
The reason that this fails is that UARTClass::init includes this code:
Unfortunately, this code assumes that ulPinMode is up-to-date. In combination with the missing update in UARTClass::init, this means that pinMode() falsely assumes that it doesn't need to change the MUX mode of the pin.
Expected behavior: pinMode should change the MUX mode of a pin, even if it was previously used by the UART.
Suggested fix, if I understand correctly: Update g_APinDescription[0].ulPinMode and g_APinDescription[1].ulPinMode in UARTClass::init.
The text was updated successfully, but these errors were encountered:
I'm running the UART (Serial1) port for a length of time, then turning it off and trying to use it as an output, but this fails silently. I expect to be able to set the mode to OUTPUT and write values to it after
Serial1.end()
has been called.The reason that this fails is that
UARTClass::init
includes this code:Notably, this doesn't update
ulPinMode
ing_APinDescription[0]
andg_APinDescription[1]
.pinMode()
does contain code that is supposed to change the MUX mode back to the correct value:Unfortunately, this code assumes that
ulPinMode
is up-to-date. In combination with the missing update inUARTClass::init
, this means thatpinMode()
falsely assumes that it doesn't need to change the MUX mode of the pin.Expected behavior:
pinMode
should change the MUX mode of a pin, even if it was previously used by the UART.Suggested fix, if I understand correctly: Update
g_APinDescription[0].ulPinMode
andg_APinDescription[1].ulPinMode
inUARTClass::init
.The text was updated successfully, but these errors were encountered: