FastDigitalPin fail to use all GPIO on ESP32
andreq opened this issue · 4 comments
I've had no success using some specific GPIO on an ESP32, mainly 17-18-19 (and some more).
Found out the fix is quite simple tho.
The code is storing the gpio BIT equivalent in a u8 instead of u32 (or u16??) in FastDigitalPin.
Some gpio bit are outside of u8 range and end up being set as 0.
I've made this change to both Bit and Port while debugging and it seem to fix it.

I'm not really setup to send a PR easily, but wouldn't mind one bit if a similar fix was PRd by someone else :).
Probably need some ifdef for ESP32 vs ESP8266 in the mix.
Hope that helps
Actually they need to be unsigned long to be very specific. Equivalent right now for both microcontroller families, but that's what the underlying implementation is using by returning 1UL for whatever reason.
Fixed, let me know if buttons AND encoders work in the latest commit from the main branch.
It works great, thx a lot!