Some Debugs and Corrections for LED-Status
This commit is contained in:
parent
2217d68026
commit
d68b562126
@ -253,7 +253,8 @@ void LED_Process(tSystem_Status newSysStatus)
|
|||||||
|
|
||||||
uint8_t color = 0;
|
uint8_t color = 0;
|
||||||
uint32_t timer = 0;
|
uint32_t timer = 0;
|
||||||
uint32_t timestamp = 0;
|
static uint32_t timestamp = 0;
|
||||||
|
timer = millis();
|
||||||
|
|
||||||
if (oldSysStatus != newSysStatus)
|
if (oldSysStatus != newSysStatus)
|
||||||
{
|
{
|
||||||
@ -261,20 +262,25 @@ void LED_Process(tSystem_Status newSysStatus)
|
|||||||
{
|
{
|
||||||
case sysStat_Startup:
|
case sysStat_Startup:
|
||||||
LED_Status = LED_Startup;
|
LED_Status = LED_Startup;
|
||||||
|
debugA("sysStat: Startup");
|
||||||
break;
|
break;
|
||||||
case sysStat_Normal:
|
case sysStat_Normal:
|
||||||
timestamp = millis() + 1500;
|
timestamp = timer + 3500;
|
||||||
LED_Status = LED_Confirm_Normal;
|
LED_Status = LED_Confirm_Normal;
|
||||||
|
debugA("sysStat: Normal");
|
||||||
break;
|
break;
|
||||||
case sysStat_Rain:
|
case sysStat_Rain:
|
||||||
timestamp = millis() + 1500;
|
timestamp = timer + 3500;
|
||||||
LED_Status = LED_Confirm_Rain;
|
LED_Status = LED_Confirm_Rain;
|
||||||
|
debugA("sysStat: Rain");
|
||||||
break;
|
break;
|
||||||
case sysStat_Purge:
|
case sysStat_Purge:
|
||||||
LED_Status = LED_Purge;
|
LED_Status = LED_Purge;
|
||||||
|
debugA("sysStat: Purge");
|
||||||
break;
|
break;
|
||||||
case sysStat_Error:
|
case sysStat_Error:
|
||||||
LED_Status = LED_Error;
|
LED_Status = LED_Error;
|
||||||
|
debugA("sysStat: Error");
|
||||||
break;
|
break;
|
||||||
case sysStat_NOP:
|
case sysStat_NOP:
|
||||||
default:
|
default:
|
||||||
@ -283,8 +289,6 @@ void LED_Process(tSystem_Status newSysStatus)
|
|||||||
oldSysStatus = newSysStatus;
|
oldSysStatus = newSysStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
timer = millis();
|
|
||||||
|
|
||||||
switch (LED_Status)
|
switch (LED_Status)
|
||||||
{
|
{
|
||||||
case LED_Startup:
|
case LED_Startup:
|
||||||
@ -296,11 +300,12 @@ void LED_Process(tSystem_Status newSysStatus)
|
|||||||
|
|
||||||
case LED_Confirm_Normal:
|
case LED_Confirm_Normal:
|
||||||
FastLED.setBrightness(255);
|
FastLED.setBrightness(255);
|
||||||
leds[0] = timer % 500 > 250 ? CRGB(0, 255, 0) : CRGB(0, 4, 0);
|
leds[0] = timer % 250 > 125 ? CRGB(0, 255, 0) : CRGB(0, 4, 0);
|
||||||
if (timestamp < timer)
|
if (timestamp < timer)
|
||||||
{
|
{
|
||||||
LED_Status = LED_Normal;
|
LED_Status = LED_Normal;
|
||||||
FastLED.setBrightness(64);
|
FastLED.setBrightness(64);
|
||||||
|
debugA("LED_Status: Confirm -> Normal");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -310,11 +315,12 @@ void LED_Process(tSystem_Status newSysStatus)
|
|||||||
|
|
||||||
case LED_Confirm_Rain:
|
case LED_Confirm_Rain:
|
||||||
FastLED.setBrightness(255);
|
FastLED.setBrightness(255);
|
||||||
leds[0] = timer % 500 > 250 ? CRGB(0, 0, 255) : CRGB(0, 0, 4);
|
leds[0] = timer % 250 > 125 ? CRGB(0, 0, 255) : CRGB(0, 0, 4);
|
||||||
if (timestamp < timer)
|
if (timestamp < timer)
|
||||||
{
|
{
|
||||||
LED_Status = LED_Rain;
|
LED_Status = LED_Rain;
|
||||||
FastLED.setBrightness(64);
|
FastLED.setBrightness(64);
|
||||||
|
debugA("LED_Status: Confirm -> Rain");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user