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
The result is that when setting the pin mode to OUTPUT, the pin is inadvertently set up in the ANALOG_OUTPUT LED driver mode, rather than the plain output GPIO mode. This isn't immediately obvious, as writing high or low to the pin will still work, but other things will break (I found it because once set as a LED output it disables the input buffer for the pin, and so switching the pin back to an input no longer works).
The AVR core uses 0x00 to 0x02, and the ESP32 one uses 0x01 to 0x12 for pin modes, with analog being 0xC0. As far as I can tell, almost any other constant would work - though maybe pick something up the other end to reduce chance of hitting something else? 0xE0?
The text was updated successfully, but these errors were encountered:
As implemented,
pinMode()
uses an additional pin mode constant to set the pin up with the LED driver:This collides with the constant used for
OUTPUT
in the ESP32 Arduino core:The result is that when setting the pin mode to
OUTPUT
, the pin is inadvertently set up in theANALOG_OUTPUT
LED driver mode, rather than the plain output GPIO mode. This isn't immediately obvious, as writing high or low to the pin will still work, but other things will break (I found it because once set as a LED output it disables the input buffer for the pin, and so switching the pin back to an input no longer works).The AVR core uses
0x00
to0x02
, and the ESP32 one uses0x01
to0x12
for pin modes, with analog being0xC0
. As far as I can tell, almost any other constant would work - though maybe pick something up the other end to reduce chance of hitting something else?0xE0
?The text was updated successfully, but these errors were encountered: