diff --git a/wled00/remote.cpp b/wled00/remote.cpp index 9e70ef5d..ca13d1e9 100644 --- a/wled00/remote.cpp +++ b/wled00/remote.cpp @@ -48,21 +48,21 @@ static int brightnessBeforeNightMode = NIGHT_MODE_DEACTIVATED; static message_structure incoming; // Pulled from the IR Remote logic but reduced to 10 steps with a constant of 3 -const byte brightnessSteps[] = { +static const byte brightnessSteps[] = { 6, 9, 14, 22, 33, 50, 75, 113, 170, 255 }; -const size_t numBrightnessSteps = sizeof(brightnessSteps) / sizeof(uint8_t); +static const size_t numBrightnessSteps = sizeof(brightnessSteps) / sizeof(uint8_t); -bool nightModeActive() { +static bool nightModeActive() { return brightnessBeforeNightMode != NIGHT_MODE_DEACTIVATED; } -void activateNightMode() { +static void activateNightMode() { brightnessBeforeNightMode = bri; bri = NIGHT_MODE_BRIGHTNESS; } -bool resetNightMode() { +static bool resetNightMode() { if (!nightModeActive()) { return false; } @@ -72,7 +72,7 @@ bool resetNightMode() { } // increment `bri` to the next `brightnessSteps` value -void brightnessUp() { +static void brightnessUp() { if (nightModeActive()) { return; } // dumb incremental search is efficient enough for so few items for (uint8_t index = 0; index < numBrightnessSteps; ++index) { @@ -84,7 +84,7 @@ void brightnessUp() { } // decrement `bri` to the next `brightnessSteps` value -void brightnessDown() { +static void brightnessDown() { if (nightModeActive()) { return; } // dumb incremental search is efficient enough for so few items for (int index = numBrightnessSteps - 1; index >= 0; --index) { @@ -95,7 +95,7 @@ void brightnessDown() { } } -void setOn() { +static void setOn() { if (resetNightMode()) { stateUpdated(CALL_MODE_BUTTON); } @@ -104,7 +104,7 @@ void setOn() { } } -void setOff() { +static void setOff() { if (resetNightMode()) { stateUpdated(CALL_MODE_BUTTON); } @@ -113,7 +113,7 @@ void setOff() { } } -void presetWithFallback(uint8_t presetID, uint8_t effectID, uint8_t paletteID) { +static void presetWithFallback(uint8_t presetID, uint8_t effectID, uint8_t paletteID) { applyPresetWithFallback(presetID, CALL_MODE_BUTTON_PRESET, effectID, paletteID); } diff --git a/wled00/wled.cpp b/wled00/wled.cpp index d32aba9b..a0c38365 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -105,7 +105,9 @@ void WLED::loop() handleIR(); // 2nd call to function needed for ESP32 to return valid results -- should be good for ESP8266, too #endif handleConnection(); + #ifndef WLED_DISABLE_ESPNOW handleRemote(); + #endif handleSerial(); #if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_PROTECT_SERVICE) // WLEDMM experimental: handleNotifications() calls strip.show(); handleTransitions modifies segments