diff --git a/src/lib/config.cpp b/src/lib/config.cpp index 5ef77dc..2269cc6 100644 --- a/src/lib/config.cpp +++ b/src/lib/config.cpp @@ -279,6 +279,7 @@ void syncTime() while (!getLocalTime(&timeinfo)) { + queueLedEffect(LED_EFFECT_CONFIGURING); configTime(preferences.getInt("gmtOffset", DEFAULT_TIME_OFFSET_SECONDS), 0, NTP_SERVER); delay(500); diff --git a/src/lib/led_handler.cpp b/src/lib/led_handler.cpp index 16612ba..806ee9c 100644 --- a/src/lib/led_handler.cpp +++ b/src/lib/led_handler.cpp @@ -333,6 +333,26 @@ void ledTask(void *parameter) blinkDelayTwoColor(100, 3, pixels.Color(8, 161, 236), pixels.Color(255, 0, 0)); 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: blinkDelayColor(250, 3, 255, 0, 0); break; diff --git a/src/lib/led_handler.hpp b/src/lib/led_handler.hpp index 4fdbd28..fe72ffa 100644 --- a/src/lib/led_handler.hpp +++ b/src/lib/led_handler.hpp @@ -18,10 +18,13 @@ const int LED_FLASH_ERROR = 0; const int LED_FLASH_SUCCESS = 1; const int LED_FLASH_UPDATE = 2; -const int LED_FLASH_BLOCK_NOTIFY = 3; -const int LED_EFFECT_START_TIMER = 4; -const int LED_EFFECT_PAUSE_TIMER = 5; -const int LED_EFFECT_HEARTBEAT = 6; + +const int LED_EFFECT_CONFIGURING = 10; + +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_CONNECTING = 101; const int LED_EFFECT_WIFI_CONNECT_ERROR = 102;