diff --git a/wled00/hue.cpp b/wled00/hue.cpp index d5fcb7cb93..bafd5bdcc2 100644 --- a/wled00/hue.cpp +++ b/wled00/hue.cpp @@ -6,6 +6,18 @@ #ifndef WLED_DISABLE_HUESYNC +// Hue bridge sync runtime state - private to this file, nothing outside hue.cpp +// needs any of it (previously these were WLED_GLOBAL, a leftover from when all +// state lived in one big extern block regardless of who actually used it). +static float hueXLast = 0, hueYLast = 0; +static uint16_t hueHueLast = 0, hueCtLast = 0; +static byte hueSatLast = 0, hueBriLast = 0; +static unsigned long hueLastRequestSent = 0; +static bool hueAuthRequired = false; +static bool hueReceived = false; +static bool hueNewKey = false; +static AsyncClient *hueClient = nullptr; + void handleHue() { if (hueReceived) diff --git a/wled00/wled.h b/wled00/wled.h index 9bafb49196..39785b15c5 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -693,13 +693,9 @@ WLED_GLOBAL bool showWelcomePage _INIT(false); #ifndef WLED_DISABLE_HUESYNC WLED_GLOBAL byte hueError _INIT(HUE_ERROR_INACTIVE); // WLED_GLOBAL uint16_t hueFailCount _INIT(0); -WLED_GLOBAL float hueXLast _INIT(0), hueYLast _INIT(0); -WLED_GLOBAL uint16_t hueHueLast _INIT(0), hueCtLast _INIT(0); -WLED_GLOBAL byte hueSatLast _INIT(0), hueBriLast _INIT(0); -WLED_GLOBAL unsigned long hueLastRequestSent _INIT(0); -WLED_GLOBAL bool hueAuthRequired _INIT(false); -WLED_GLOBAL bool hueReceived _INIT(false); -WLED_GLOBAL bool hueStoreAllowed _INIT(false), hueNewKey _INIT(false); +// hueXLast/hueYLast/hueHueLast/hueCtLast/hueSatLast/hueBriLast/hueLastRequestSent/ +// hueAuthRequired/hueReceived/hueNewKey/hueClient are private to hue.cpp - see there. +WLED_GLOBAL bool hueStoreAllowed _INIT(false); #endif // countdown @@ -794,9 +790,6 @@ WLED_GLOBAL AsyncWebServer server _INIT_N(((80, {0, WLED_REQUEST_MAX_QUEUE, WLED #ifdef WLED_ENABLE_WEBSOCKETS WLED_GLOBAL AsyncWebSocket ws _INIT_N((("/ws"))); #endif -#ifndef WLED_DISABLE_HUESYNC -WLED_GLOBAL AsyncClient *hueClient _INIT(NULL); -#endif WLED_GLOBAL AsyncWebHandler *editHandler _INIT(nullptr); // udp interface objects