diff --git a/code/espurna/button.ino b/code/espurna/button.ino index 69fde4e6..4bb269fe 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -568,7 +568,7 @@ void buttonSetup() { _buttons.reserve(buttons); - for (unsigned char index = 0; index < buttons; ++index) { + for (unsigned char index = 0; index < ButtonsMax; ++index) { const auto pin = getSetting({"btnGPIO", index}, _buttonPin(index)); if (!gpioValid(pin)) { break; diff --git a/code/espurna/led.ino b/code/espurna/led.ino index 79e5778b..9197128a 100644 --- a/code/espurna/led.ino +++ b/code/espurna/led.ino @@ -336,7 +336,7 @@ void ledSetup() { _leds.reserve(leds); - for (unsigned char index=0; index < leds; ++index) { + for (unsigned char index=0; index < LedsMax; ++index) { const auto pin = getSetting({"ledGPIO", index}, _ledPin(index)); if (!gpioValid(pin)) { break;