NFC: Call PinMapping.get() not every iteration.

This commit is contained in:
Stefan Oberhumer 2023-10-05 21:19:17 +02:00
parent d419fd4794
commit be88da7b26

View File

@ -22,8 +22,8 @@ void LedSingleClass::init()
_updateTimeout.set(LEDSINGLE_UPDATE_INTERVAL); _updateTimeout.set(LEDSINGLE_UPDATE_INTERVAL);
turnAllOn(); turnAllOn();
auto& pin = PinMapping.get();
for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) { for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) {
auto& pin = PinMapping.get();
if (pin.led[i] >= 0) { if (pin.led[i] >= 0) {
pinMode(pin.led[i], OUTPUT); pinMode(pin.led[i], OUTPUT);
@ -74,8 +74,8 @@ void LedSingleClass::loop()
_ledState[1] = LedState_t::Off; _ledState[1] = LedState_t::Off;
} }
auto& pin = PinMapping.get();
for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) { for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) {
auto& pin = PinMapping.get();
if (pin.led[i] < 0) { if (pin.led[i] < 0) {
continue; continue;