diff --git a/wled00/button.cpp b/wled00/button.cpp index 4e0d982038..ef56cea7c6 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -13,6 +13,10 @@ #define WLED_LONG_BRI_STEPS 16 // how much to increase/decrease the brightness with each long press repetition static const char _mqtt_topic_button[] PROGMEM = "%s/button/%d"; // optimize flash usage + +// Runtime state private to this file - previously WLED_GLOBAL, a leftover from +// when all state lived in one big extern block regardless of who used it. +static unsigned long lastOnTime = 0; static bool buttonBriDirection = false; // true: increase brightness, false: decrease brightness void shortPressAction(uint8_t b) diff --git a/wled00/wled.h b/wled00/wled.h index 9bafb49196..777f461b3d 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -611,7 +611,7 @@ WLED_GLOBAL byte briNlT _INIT(0); // current nightlight brig WLED_GLOBAL byte colNlT[] _INIT_N(({ 0, 0, 0, 0 })); // current nightlight color // brightness -WLED_GLOBAL unsigned long lastOnTime _INIT(0); +// lastOnTime is private to button.cpp - see there. WLED_GLOBAL bool offMode _INIT(!turnOnAtBoot); WLED_GLOBAL byte briS _INIT(128); // default brightness WLED_GLOBAL byte bri _INIT(briS); // global brightness (set)