File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ typedef struct Segment {
380380 };
381381 uint8_t grouping, spacing;
382382 uint8_t opacity;
383+ uint8_t lastBri; // WLEDMM optimization for black-to-black "transitions"
383384 bool needsBlank; // WLEDMM indicates that Segment needs to be blanked (due to change of mirror / reverse / transpose / spacing)
384385 uint32_t colors[NUM_COLORS];
385386 uint8_t cct; // 0==1900K, 255==10091K
@@ -490,6 +491,7 @@ typedef struct Segment {
490491 grouping (1 ),
491492 spacing (0 ),
492493 opacity (255 ),
494+ lastBri (255 ),
493495 needsBlank (false ),
494496 colors{DEFAULT_COLOR,BLACK,BLACK},
495497 cct (127 ),
Original file line number Diff line number Diff line change @@ -1935,6 +1935,7 @@ void WS2812FX::service() {
19351935 now = millis() + timebase;
19361936#endif
19371937 seg.startFrame (); // WLEDMM
1938+ if (!_triggered && (seg.currentBri (seg.opacity ) == 0 ) && (seg.lastBri == 0 )) continue ; // WLEDMM skip totally black segments
19381939 // effect blending (execute previous effect)
19391940 // actual code may be a bit more involved as effects have runtime data including allocated memory
19401941 // if (seg.transitional && seg._modeP) (*_mode[seg._modeP])(progress());
@@ -1944,6 +1945,7 @@ void WS2812FX::service() {
19441945 if (seg.mode != FX_MODE_HALLOWEEN_EYES) seg.call ++;
19451946 if (seg.transitional && frameDelay > FRAMETIME) frameDelay = FRAMETIME; // force faster updates during transition
19461947
1948+ seg.lastBri = seg.currentBri (seg.on ? seg.opacity :0 ); // WLEDMM remember for next time
19471949 seg.handleTransition ();
19481950 }
19491951
You can’t perform that action at this time.
0 commit comments