diff --git a/main/accessors/settingsaccessors.h b/main/accessors/settingsaccessors.h index f924ef8..57a61f3 100644 --- a/main/accessors/settingsaccessors.h +++ b/main/accessors/settingsaccessors.h @@ -179,8 +179,10 @@ struct EnableLedstripStVOFrontlight : public RefAccessorSaveSettings { boo struct AnimationMultiplierAccessor : public RefAccessorSaveSettings { int16_t &getRef() const override { return settings.ledstrip.animationMultiplier; } }; struct LedstripBrightnessAccessor : public RefAccessorSaveSettings { uint8_t &getRef() const override { return settings.ledstrip.brightness; } }; struct LedstripEnableBlinkAnimationAccessor : public RefAccessorSaveSettings { bool &getRef() const override { return settings.ledstrip.enableAnimBlink; } }; +#ifdef FEATURE_OTA struct LedstripOtaAnimationAccessor : public RefAccessorSaveSettings { OtaAnimationModes &getRef() const override { return settings.ledstrip.otaMode; } }; #endif +#endif // Battery struct BatterySeriesCellsAccessor : public RefAccessorSaveSettings { uint8_t &getRef() const override { return settings.battery.cellsSeries; } }; diff --git a/main/displays/menus/ledstripmenu.cpp b/main/displays/menus/ledstripmenu.cpp index f0ea464..cdeba51 100644 --- a/main/displays/menus/ledstripmenu.cpp +++ b/main/displays/menus/ledstripmenu.cpp @@ -127,7 +127,9 @@ LedstripMenu::LedstripMenu() constructMenuItem, SwitchScreenAction>>(); constructMenuItem, SwitchScreenAction>>(); +#ifdef FEATURE_OTA if (!simplified) { constructMenuItem, SwitchScreenAction>>(); } +#endif constructMenuItem, SwitchScreenAction>>(); if (!simplified) { constructMenuItem, SwitchScreenAction>>(); } if (!simplified) { constructMenuItem, SwitchScreenAction>>(); } diff --git a/main/displays/menus/ledstripselectotamode.h b/main/displays/menus/ledstripselectotamode.h index ad40792..f49e54d 100644 --- a/main/displays/menus/ledstripselectotamode.h +++ b/main/displays/menus/ledstripselectotamode.h @@ -11,7 +11,7 @@ #include "accessors/settingsaccessors.h" #include "ledstripmenu.h" -#ifdef FEATURE_LEDSTRIP +#if defined(FEATURE_LEDSTRIP) && defined(FEATURE_OTA) using namespace espgui; template diff --git a/main/ledstrip.cpp b/main/ledstrip.cpp index f8763dd..8aed3aa 100644 --- a/main/ledstrip.cpp +++ b/main/ledstrip.cpp @@ -213,7 +213,12 @@ void updateLedStrip() void showAnimation() { - if (settings.ledstrip.enableLedAnimation && !simplified && !(asyncOtaTaskStarted && settings.ledstrip.otaMode != OtaAnimationModes::None)) + if (settings.ledstrip.enableLedAnimation + && !simplified +#ifdef FEATURE_OTA + && !(asyncOtaTaskStarted && settings.ledstrip.otaMode != OtaAnimationModes::None) +#endif + ) { if (animation_type == LedstripAnimation::DefaultRainbow) showDefaultLedstrip(); else if (animation_type == LedstripAnimation::BetterRainbow) showBetterRainbow(); @@ -221,17 +226,20 @@ void showAnimation() else if (animation_type == LedstripAnimation::CustomColor) showCustomColor(); else showDefaultLedstrip(); } +#ifdef FEATURE_OTA else if (asyncOtaTaskStarted && settings.ledstrip.otaMode != OtaAnimationModes::None) { // show ota animation showOtaAnimation(); } +#endif else { std::fill(std::begin(leds), std::end(leds), CRGB{0, 0, 0}); } } +#ifdef FEATURE_OTA void showOtaAnimation() { std::fill(std::begin(leds), std::end(leds), CRGB{0,0,0}); @@ -260,6 +268,7 @@ void showOtaAnimation() } } } +#endif void showBetterRainbow() { diff --git a/main/ledstrip.h b/main/ledstrip.h index e8edea8..2041841 100644 --- a/main/ledstrip.h +++ b/main/ledstrip.h @@ -19,12 +19,14 @@ enum Bobbycar_Side FRONT }; +#ifdef FEATURE_OTA enum OtaAnimationModes { None, GreenProgressBar, ColorChangeAll }; +#endif extern std::vector leds; extern uint8_t gHue; @@ -37,7 +39,9 @@ void showAnimation(); void showBetterRainbow(); void showSpeedSyncAnimation(); void showCustomColor(); +#ifdef FEATURE_OTA void showOtaAnimation(); +#endif void initLedStrip(); void updateLedStrip(); diff --git a/main/presets.h b/main/presets.h index c99feab..34c1f72 100644 --- a/main/presets.h +++ b/main/presets.h @@ -266,7 +266,9 @@ constexpr Settings::Ledstrip defaultLedstrip { .animationMultiplier = 10, .brightness = 255, .enableAnimBlink = false, +#ifdef FEATURE_OTA .otaMode = OtaAnimationModes::GreenProgressBar +#endif }; #endif diff --git a/main/settings.h b/main/settings.h index 6ba38b4..87549e4 100644 --- a/main/settings.h +++ b/main/settings.h @@ -183,7 +183,9 @@ struct Settings int16_t animationMultiplier; uint8_t brightness; bool enableAnimBlink; +#ifdef FEATURE_OTA OtaAnimationModes otaMode; +#endif } ledstrip; #endif @@ -330,7 +332,9 @@ void Settings::executeForEveryCommonSetting(T &&callable) callable("ledAnimMul", ledstrip.animationMultiplier); callable("ledbrightness", ledstrip.brightness); callable("enAnimBlink", ledstrip.enableAnimBlink); +#ifdef FEATURE_OTA callable("ledOtaAnim", ledstrip.otaMode); +#endif #endif callable("batteryCS", battery.cellsSeries); diff --git a/main/udpcloud.cpp b/main/udpcloud.cpp index 8e54855..443bdfb 100644 --- a/main/udpcloud.cpp +++ b/main/udpcloud.cpp @@ -4,11 +4,9 @@ constexpr const char * const TAG = "bobbycloud"; // 3rd party includes #include #include -#ifdef FEATURE_OTA #include #include #include -#endif // local includes #include "udpcloud.h"