mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
changed ledStripIsOnFlag to ledStripEnabled and ledStripEnabled fail check
This commit is contained in:
parent
bfdb4d7564
commit
bfa79ab010
2 changed files with 16 additions and 7 deletions
|
@ -48,9 +48,12 @@
|
||||||
#include "io/ledstrip.h"
|
#include "io/ledstrip.h"
|
||||||
|
|
||||||
static bool ledStripInitialised = false;
|
static bool ledStripInitialised = false;
|
||||||
static bool ledStripIsOnFlag = true;
|
|
||||||
static failsafe_t* failsafe;
|
static failsafe_t* failsafe;
|
||||||
|
|
||||||
|
static bool ledStripEnabled = true;
|
||||||
|
static void ledStripDisable(void);
|
||||||
|
|
||||||
//#define USE_LED_ANIMATION
|
//#define USE_LED_ANIMATION
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
|
@ -743,14 +746,20 @@ void updateLedStrip(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( IS_RC_MODE_ACTIVE(BOXLEDLOW)){
|
if ( IS_RC_MODE_ACTIVE(BOXLEDLOW)){
|
||||||
if (ledStripIsOnFlag){
|
if (ledStripEnabled){
|
||||||
ledStripDisable();
|
ledStripDisable();
|
||||||
ledStripIsOnFlag = false;
|
ledStripEnabled = false;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}else{
|
}else{
|
||||||
ledStripIsOnFlag = true;
|
ledStripEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ledStripEnabled){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t now = micros();
|
uint32_t now = micros();
|
||||||
|
|
||||||
|
@ -895,7 +904,7 @@ void ledStripEnable(void)
|
||||||
ws2811LedStripInit();
|
ws2811LedStripInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ledStripDisable(void)
|
static void ledStripDisable(void)
|
||||||
{
|
{
|
||||||
setStripColor(&hsv_black);
|
setStripColor(&hsv_black);
|
||||||
ws2811UpdateStrip();
|
ws2811UpdateStrip();
|
||||||
|
|
|
@ -73,5 +73,5 @@ bool parseColor(uint8_t index, const char *colorConfig);
|
||||||
void applyDefaultColors(hsvColor_t *colors, uint8_t colorCount);
|
void applyDefaultColors(hsvColor_t *colors, uint8_t colorCount);
|
||||||
|
|
||||||
void ledStripEnable(void);
|
void ledStripEnable(void);
|
||||||
void ledStripDisable(void);
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue