From 3243dafb615d250c0cdf0e7cd4d490cfc091e179 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Fri, 13 Mar 2020 07:15:07 +0300 Subject: [PATCH] cfg: check for led and button GPIO settings (#2177) In case board configuration is empty, loop should try to check at least once --- code/espurna/button.ino | 2 +- code/espurna/led.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;