Skip to content

Commit

Permalink
NFC: Call PinMapping.get() not every iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanOberhumer committed Oct 6, 2023
1 parent d419fd4 commit be88da7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Led_Single.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void LedSingleClass::init()
_updateTimeout.set(LEDSINGLE_UPDATE_INTERVAL);
turnAllOn();

auto& pin = PinMapping.get();
for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) {
auto& pin = PinMapping.get();

if (pin.led[i] >= 0) {
pinMode(pin.led[i], OUTPUT);
Expand Down Expand Up @@ -74,8 +74,8 @@ void LedSingleClass::loop()
_ledState[1] = LedState_t::Off;
}

auto& pin = PinMapping.get();
for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) {
auto& pin = PinMapping.get();

if (pin.led[i] < 0) {
continue;
Expand Down

0 comments on commit be88da7

Please sign in to comment.