Browse Source
cfg: check for led and button GPIO settings (#2177)
In case board configuration is empty, loop should try to check at least once
mcspr-patch-1
Max Prokhorov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
code/espurna/button.ino
-
code/espurna/led.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; |
|
|
|
|
|
@ -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; |
|
|
|