diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 1758cd74..7519b1ff 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -855,8 +855,14 @@ void ledStripInit(ledConfig_t *ledConfigsToUse, hsvColor_t *colorsToUse, failsaf ledConfigs = ledConfigsToUse; colors = colorsToUse; failsafe = failsafeToUse; + ledStripInitialised = false; +} +void ledStripEnable(void) +{ reevalulateLedConfig(); ledStripInitialised = true; + + ws2811LedStripInit(); } #endif diff --git a/src/main/io/ledstrip.h b/src/main/io/ledstrip.h index f3a7195f..72f470ec 100644 --- a/src/main/io/ledstrip.h +++ b/src/main/io/ledstrip.h @@ -66,3 +66,5 @@ void generateLedConfig(uint8_t ledIndex, char *ledConfigBuffer, size_t bufferSiz bool parseColor(uint8_t index, char *colorConfig); void applyDefaultColors(hsvColor_t *colors, uint8_t colorCount); +void ledStripEnable(void); + diff --git a/src/main/main.c b/src/main/main.c index 31702a3f..8596c887 100755 --- a/src/main/main.c +++ b/src/main/main.c @@ -28,7 +28,6 @@ #include "drivers/system.h" #include "drivers/gpio.h" #include "drivers/light_led.h" -#include "drivers/light_ws2811strip.h" #include "drivers/sound_beeper.h" #include "drivers/timer.h" #include "drivers/serial.h" @@ -248,9 +247,10 @@ void init(void) #endif #ifdef LED_STRIP + ledStripInit(masterConfig.ledConfigs, masterConfig.colors, failsafe); + if (feature(FEATURE_LED_STRIP)) { - ws2811LedStripInit(); - ledStripInit(masterConfig.ledConfigs, masterConfig.colors, failsafe); + ledStripEnable(); } #endif