mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +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"
|
||||
|
||||
static bool ledStripInitialised = false;
|
||||
static bool ledStripIsOnFlag = true;
|
||||
|
||||
static failsafe_t* failsafe;
|
||||
|
||||
static bool ledStripEnabled = true;
|
||||
static void ledStripDisable(void);
|
||||
|
||||
//#define USE_LED_ANIMATION
|
||||
|
||||
// timers
|
||||
|
@ -743,14 +746,20 @@ void updateLedStrip(void)
|
|||
}
|
||||
|
||||
if ( IS_RC_MODE_ACTIVE(BOXLEDLOW)){
|
||||
if (ledStripIsOnFlag){
|
||||
if (ledStripEnabled){
|
||||
ledStripDisable();
|
||||
ledStripIsOnFlag = false;
|
||||
ledStripEnabled = false;
|
||||
}
|
||||
return;
|
||||
}else{
|
||||
ledStripIsOnFlag = true;
|
||||
ledStripEnabled = true;
|
||||
}
|
||||
|
||||
if (!ledStripEnabled){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
uint32_t now = micros();
|
||||
|
||||
|
@ -895,7 +904,7 @@ void ledStripEnable(void)
|
|||
ws2811LedStripInit();
|
||||
}
|
||||
|
||||
void ledStripDisable(void)
|
||||
static void ledStripDisable(void)
|
||||
{
|
||||
setStripColor(&hsv_black);
|
||||
ws2811UpdateStrip();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue