mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Ensure led strip is configured in updateLedStrip method to prevent crash
when enabling the feature from the cli.
This commit is contained in:
parent
d60183d91d
commit
1790e082fe
1 changed files with 3 additions and 1 deletions
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
#include "io/ledstrip.h"
|
#include "io/ledstrip.h"
|
||||||
|
|
||||||
|
static bool configured = false;
|
||||||
static failsafe_t* failsafe;
|
static failsafe_t* failsafe;
|
||||||
|
|
||||||
#if MAX_LED_STRIP_LENGTH > WS2811_LED_STRIP_LENGTH
|
#if MAX_LED_STRIP_LENGTH > WS2811_LED_STRIP_LENGTH
|
||||||
|
@ -644,7 +645,7 @@ static void applyLedAnimationLayer(void)
|
||||||
|
|
||||||
void updateLedStrip(void)
|
void updateLedStrip(void)
|
||||||
{
|
{
|
||||||
if (!isWS2811LedStripReady()) {
|
if (!(configured && isWS2811LedStripReady())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,5 +733,6 @@ void ledStripInit(ledConfig_t *ledConfigsToUse, failsafe_t* failsafeToUse)
|
||||||
ledConfigs = ledConfigsToUse;
|
ledConfigs = ledConfigsToUse;
|
||||||
failsafe = failsafeToUse;
|
failsafe = failsafeToUse;
|
||||||
reevalulateLedConfig();
|
reevalulateLedConfig();
|
||||||
|
configured = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue