mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +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"
|
||||
|
||||
static bool configured = false;
|
||||
static failsafe_t* failsafe;
|
||||
|
||||
#if MAX_LED_STRIP_LENGTH > WS2811_LED_STRIP_LENGTH
|
||||
|
@ -644,7 +645,7 @@ static void applyLedAnimationLayer(void)
|
|||
|
||||
void updateLedStrip(void)
|
||||
{
|
||||
if (!isWS2811LedStripReady()) {
|
||||
if (!(configured && isWS2811LedStripReady())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -732,5 +733,6 @@ void ledStripInit(ledConfig_t *ledConfigsToUse, failsafe_t* failsafeToUse)
|
|||
ledConfigs = ledConfigsToUse;
|
||||
failsafe = failsafeToUse;
|
||||
reevalulateLedConfig();
|
||||
configured = true;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue