Add LED effect when retrying time synchronization
This commit is contained in:
parent
aea69d54b6
commit
b8428e1650
3 changed files with 28 additions and 4 deletions
|
@ -279,6 +279,7 @@ void syncTime()
|
||||||
|
|
||||||
while (!getLocalTime(&timeinfo))
|
while (!getLocalTime(&timeinfo))
|
||||||
{
|
{
|
||||||
|
queueLedEffect(LED_EFFECT_CONFIGURING);
|
||||||
configTime(preferences.getInt("gmtOffset", DEFAULT_TIME_OFFSET_SECONDS), 0,
|
configTime(preferences.getInt("gmtOffset", DEFAULT_TIME_OFFSET_SECONDS), 0,
|
||||||
NTP_SERVER);
|
NTP_SERVER);
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
|
@ -333,6 +333,26 @@ void ledTask(void *parameter)
|
||||||
blinkDelayTwoColor(100, 3, pixels.Color(8, 161, 236),
|
blinkDelayTwoColor(100, 3, pixels.Color(8, 161, 236),
|
||||||
pixels.Color(255, 0, 0));
|
pixels.Color(255, 0, 0));
|
||||||
break;
|
break;
|
||||||
|
case LED_EFFECT_CONFIGURING:
|
||||||
|
for (int i = NEOPIXEL_COUNT; i--; i > 0)
|
||||||
|
{
|
||||||
|
for (int j = NEOPIXEL_COUNT; j--; j > 0)
|
||||||
|
{
|
||||||
|
uint32_t c = pixels.Color(0, 0, 0);
|
||||||
|
if (i == j)
|
||||||
|
c = pixels.Color(0, 0, 255);
|
||||||
|
|
||||||
|
pixels.setPixelColor(j, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
pixels.show();
|
||||||
|
|
||||||
|
delay(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
pixels.clear();
|
||||||
|
pixels.show();
|
||||||
|
break;
|
||||||
case LED_FLASH_ERROR:
|
case LED_FLASH_ERROR:
|
||||||
blinkDelayColor(250, 3, 255, 0, 0);
|
blinkDelayColor(250, 3, 255, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -18,10 +18,13 @@
|
||||||
const int LED_FLASH_ERROR = 0;
|
const int LED_FLASH_ERROR = 0;
|
||||||
const int LED_FLASH_SUCCESS = 1;
|
const int LED_FLASH_SUCCESS = 1;
|
||||||
const int LED_FLASH_UPDATE = 2;
|
const int LED_FLASH_UPDATE = 2;
|
||||||
const int LED_FLASH_BLOCK_NOTIFY = 3;
|
|
||||||
const int LED_EFFECT_START_TIMER = 4;
|
const int LED_EFFECT_CONFIGURING = 10;
|
||||||
const int LED_EFFECT_PAUSE_TIMER = 5;
|
|
||||||
const int LED_EFFECT_HEARTBEAT = 6;
|
const int LED_FLASH_BLOCK_NOTIFY = 4;
|
||||||
|
const int LED_EFFECT_START_TIMER = 5;
|
||||||
|
const int LED_EFFECT_PAUSE_TIMER = 6;
|
||||||
|
const int LED_EFFECT_HEARTBEAT = 7;
|
||||||
const int LED_EFFECT_WIFI_WAIT_FOR_CONFIG = 100;
|
const int LED_EFFECT_WIFI_WAIT_FOR_CONFIG = 100;
|
||||||
const int LED_EFFECT_WIFI_CONNECTING = 101;
|
const int LED_EFFECT_WIFI_CONNECTING = 101;
|
||||||
const int LED_EFFECT_WIFI_CONNECT_ERROR = 102;
|
const int LED_EFFECT_WIFI_CONNECT_ERROR = 102;
|
||||||
|
|
Loading…
Reference in a new issue