Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wled00/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading