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
parent
commit
3243dafb61
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      code/espurna/button.ino
  2. +1
    -1
      code/espurna/led.ino

+ 1
- 1
code/espurna/button.ino View File

@ -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;


+ 1
- 1
code/espurna/led.ino View File

@ -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;


Loading…
Cancel
Save