dasdgw / yoradio

Web-radio based on ESP32-audioI2S library
GNU General Public License v3.0
1 stars 1 forks source link

fix: fix error when defining some button but not all #10

Closed frankalicious closed 2 days ago

frankalicious commented 1 week ago

By returning in the constructor if the pin number is 255 we prevent the error during setup when calling pinMode with an invalid pin number.

[   312][E][esp32-hal-gpio.c:107] __pinMode(): Invalid IO 255 selected

By adding (i == 7 && BTN_MODE == 255) to the loop we prevent the error

[  2408][E][esp32-hal-periman.c:174] perimanGetPinBus(): Invalid pin: 255
[  2415][E][esp32-hal-gpio.c:188] __digitalRead(): IO 255 is not set as GPIO.

Fixes #9.