Skip to content
Open
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
8 changes: 8 additions & 0 deletions wled00/led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
* LED methods
*/

// 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 bool transitionActive = false;
static unsigned long transitionStartTime;
static unsigned long lastNlUpdate;
static byte briNlT = 0; // current nightlight brightness
static byte colNlT[] = { 0, 0, 0, 0 }; // current nightlight color

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will conflict my PR #5700 but not a big deal.


// applies chosen setment properties to legacy values
void setValuesFromSegment(uint8_t s) {
const Segment& seg = strip.getSegment(s);
Expand Down
7 changes: 2 additions & 5 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,9 @@ WLED_GLOBAL uint8_t paletteBlend _INIT(0); // determines blending and wra

// transitions
WLED_GLOBAL uint8_t blendingStyle _INIT(0); // effect blending/transitionig style
WLED_GLOBAL bool transitionActive _INIT(false);
// transitionActive/transitionStartTime are private to led.cpp - see there.
WLED_GLOBAL uint16_t transitionDelay _INIT(750); // global transition duration
WLED_GLOBAL uint16_t transitionDelayDefault _INIT(750); // default transition time (stored in cfg.json)
WLED_GLOBAL unsigned long transitionStartTime;
WLED_GLOBAL bool jsonTransitionOnce _INIT(false); // flag to override transitionDelay (playlist, JSON API: "live" & "seg":{"i"} & "tt")
WLED_GLOBAL uint8_t randomPaletteChangeTime _INIT(5); // amount of time [s] between random palette changes (min: 1s, max: 255s)
WLED_GLOBAL bool useHarmonicRandomPalette _INIT(true); // use *harmonic* random palette generation (nicer looking) or truly random
Expand All @@ -606,9 +605,7 @@ WLED_GLOBAL bool nightlightActiveOld _INIT(false);
WLED_GLOBAL uint32_t nightlightDelayMs _INIT(10);
WLED_GLOBAL byte nightlightDelayMinsDefault _INIT(nightlightDelayMins);
WLED_GLOBAL unsigned long nightlightStartTime;
WLED_GLOBAL unsigned long lastNlUpdate;
WLED_GLOBAL byte briNlT _INIT(0); // current nightlight brightness
WLED_GLOBAL byte colNlT[] _INIT_N(({ 0, 0, 0, 0 })); // current nightlight color
// lastNlUpdate/briNlT/colNlT are private to led.cpp - see there.

// brightness
WLED_GLOBAL unsigned long lastOnTime _INIT(0);
Expand Down
Loading