diff --git a/wled00/colors.cpp b/wled00/colors.cpp index 6ddc4ec892..767b8cf0b2 100644 --- a/wled00/colors.cpp +++ b/wled00/colors.cpp @@ -144,6 +144,10 @@ uint32_t ColorFromPalette(const CRGBPalette16& pal, unsigned index, uint8_t brig return RGBW32(red1,green1,blue1,0); } +// 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 byte lastRandomIndex = 0; // used to save last random color so the new one is not the same + void setRandomColor(byte* rgb) { lastRandomIndex = get_random_wheel_index(lastRandomIndex); diff --git a/wled00/wled.h b/wled00/wled.h index 9bafb49196..192d087629 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -585,7 +585,7 @@ WLED_GLOBAL bool interfacesInited _INIT(false); WLED_GLOBAL bool wasConnected _INIT(false); // color -WLED_GLOBAL byte lastRandomIndex _INIT(0); // used to save last random color so the new one is not the same +// lastRandomIndex is private to colors.cpp - see there. WLED_GLOBAL std::vector customPalettes; // custom palettes (file-based, IDs grow downwards starting at 200) WLED_GLOBAL std::vector usermodPalettes; // usermod-registered palettes (IDs 255, 254, 253...) WLED_GLOBAL uint8_t paletteBlend _INIT(0); // determines blending and wrapping of palette: 0: blend, wrap if moving (SEGMENT.speed>0); 1: blend, always wrap; 2: blend, never wrap; 3: don't blend or wrap