Merge branch 'master' into master-merge

This commit is contained in:
Blaž Kristan
2022-03-07 09:44:35 +01:00
33 changed files with 3886 additions and 3453 deletions

View File

@@ -247,7 +247,7 @@ class WS2812FX {
// segment parameters
public:
typedef struct Segment { // 30 (32 in memory) bytes
typedef struct Segment { // 31 (32 in memory) bytes
uint16_t start;
uint16_t stop; //segment invalid if stop == 0
uint16_t offset;
@@ -260,6 +260,7 @@ class WS2812FX {
uint8_t opacity;
uint32_t colors[NUM_COLORS];
uint8_t cct; //0==1900K, 255==10091K
uint8_t _capabilities;
char *name;
bool setColor(uint8_t slot, uint32_t c, uint8_t segn) { //returns true if changed
if (slot >= NUM_COLORS || segn >= MAX_NUM_SEGMENTS) return false;
@@ -335,7 +336,8 @@ class WS2812FX {
return vLength;
}
uint8_t differs(Segment& b);
uint8_t getLightCapabilities();
inline uint8_t getLightCapabilities() {return _capabilities;}
void refreshLightCapabilities();
} segment;
// segment runtime parameters
@@ -887,14 +889,15 @@ class WS2812FX {
uint32_t _colors_t[3];
uint8_t _bri_t;
bool _no_rgb = false;
uint8_t _segment_index = 0;
uint8_t _segment_index_palette_last = 99;
uint8_t _mainSegment;
segment _segments[MAX_NUM_SEGMENTS] = { // SRAM footprint: 24 bytes per element
// start, stop, offset, speed, intensity, palette, mode, options, grouping, spacing, opacity (unused), color[]
{0, 7, 0, DEFAULT_SPEED, 128, 0, DEFAULT_MODE, NO_OPTIONS, 1, 0, 255, {DEFAULT_COLOR}}
// start, stop, offset, speed, intensity, palette, mode, options, grouping, spacing, opacity (unused), color[], capabilities
{0, 7, 0, DEFAULT_SPEED, 128, 0, DEFAULT_MODE, NO_OPTIONS, 1, 0, 255, {DEFAULT_COLOR}, 0}
};
segment_runtime _segment_runtimes[MAX_NUM_SEGMENTS]; // SRAM footprint: 28 bytes per element
friend class Segment_runtime;