Added White Timeout

This commit is contained in:
admin 2025-03-23 23:33:24 -07:00
parent 58f311d738
commit 5a34353a32
3 changed files with 59 additions and 47 deletions

View File

@ -8,6 +8,8 @@
#define SOLID_COLOR_INDEX -2 #define SOLID_COLOR_INDEX -2
#define OFF_INDEX -1 #define OFF_INDEX -1
extern uint32_t whiteTimeout;
typedef struct { typedef struct {
int AnimationIndex; int AnimationIndex;
union { union {

View File

@ -13,6 +13,8 @@
#define FASTLED_CORE 0 #define FASTLED_CORE 0
static const char* tag = "strips"; static const char* tag = "strips";
uint32_t whiteTimeout = 0;
TaskHandle_t Animation_Task_Handle; TaskHandle_t Animation_Task_Handle;
LEDSTRIP_SETTINGS ledSettings[2]; LEDSTRIP_SETTINGS ledSettings[2];
volatile bool AnimationLooping = false; volatile bool AnimationLooping = false;

View File

@ -195,7 +195,6 @@ void setup()
void loop() void loop()
{ {
// Button Scanning // Button Scanning
ON_EVERY_N_MILLISECONDS(10) ON_EVERY_N_MILLISECONDS(10)
{ {
@ -291,6 +290,15 @@ void loop()
print_task_watermarks(); print_task_watermarks();
} }
#endif #endif
// Turn off white light after timeout
if(whiteTimeout > 0){
whiteTimeout--;
if(whiteTimeout == 0){
Lights_Set_White(0);
}
}
} }
void setupLogLevels(esp_log_level_t logLevel) void setupLogLevels(esp_log_level_t logLevel)