Skip to content

Commit

Permalink
fix 8266 builds
Browse files Browse the repository at this point in the history
wled00/FX_fcn.cpp:974:16: error: '_isSuperSimpleSegment' was not declared in this scope
  • Loading branch information
softhack007 committed Aug 18, 2024
1 parent 1ef13c2 commit b47c55d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,10 @@ typedef struct Segment {
static size_t _usedSegmentData; // WLEDMM uint16_t is too small
void setPixelColorXY_fast(int x, int y,uint32_t c, uint32_t scaled_col, int cols, int rows); // set relative pixel within segment with color - faster, but no error checking!!!

bool _isSimpleSegment = false; // simple = no grouping or spacing - mirror, transpose or reverse allowed
bool _isSuperSimpleSegment = false; // superSimple = no grouping or spacing, no mirror - only transpose or reverse allowed
#ifdef WLEDMM_FASTPATH
// WLEDMM cache some values that won't change while drawing a frame
bool _isSimpleSegment = false;
bool _isSuperSimpleSegment = false;
bool _isValid2D = false;
uint8_t _brightness = 255; // final pixel brightness - including transitions and segment opacity
bool _firstFill = true; // dirty HACK support
Expand Down
5 changes: 3 additions & 2 deletions wled00/FX_2Dfcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,12 @@ uint32_t __attribute__((hot)) WS2812FX::getPixelColorXY(uint16_t x, uint16_t y)

// WLEDMM cache some values so we don't need to re-calc then for each pixel
void Segment::startFrame(void) {
_isSimpleSegment = (grouping == 1) && (spacing == 0); // we can handle pixels faster when no grouping or spacing is involved
_isSuperSimpleSegment = !mirror && !mirror_y && (grouping == 1) && (spacing == 0); // fastest - we only draw one pixel per call

#ifdef WLEDMM_FASTPATH
_isValid2D = isActive() && is2D();
_brightness = currentBri(on ? opacity : 0);
_isSimpleSegment = (grouping == 1) && (spacing == 0); // we can handle pixels faster when no grouping or spacing is involved
_isSuperSimpleSegment = !mirror && !mirror_y && (grouping == 1) && (spacing == 0); // fastest - we only draw one pixel per call
// if (reverse_y) _isSimpleSegment = false; // for A/B testing
_2dWidth = is2D() ? calc_virtualWidth() : virtualLength();
_2dHeight = calc_virtualHeight();
Expand Down
15 changes: 7 additions & 8 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,11 @@ Segment::Segment(const Segment &orig) {
DEBUG_PRINTLN(F("-- Copy segment constructor --"));
memcpy((void*)this, (void*)&orig, sizeof(Segment)); //WLEDMM copy to this
transitional = false; // copied segment cannot be in transition
#ifdef WLEDMM_FASTPATH
// WLEDMM temporarily prevent any fast draw calls to the new segment
// _isValid2D = false;
_isSimpleSegment = false;
_isSuperSimpleSegment = false;
#endif

name = nullptr;
data = nullptr;
_dataLen = 0;
Expand Down Expand Up @@ -149,11 +148,11 @@ void Segment::allocLeds() {
// move constructor --> moves everything (including buffer) from orig to this
Segment::Segment(Segment &&orig) noexcept {
DEBUG_PRINTLN(F("-- Move segment constructor --"));
#ifdef WLEDMM_FASTPATH

// WLEDMM temporarily prevent any fast draw calls to old and new segment
orig._isSimpleSegment = false;
orig._isSuperSimpleSegment = false;
#endif

memcpy((void*)this, (void*)&orig, sizeof(Segment));
orig.transitional = false; // old segment cannot be in transition any more
#ifdef WLEDMM_FASTPATH
Expand Down Expand Up @@ -184,12 +183,12 @@ Segment& Segment::operator= (const Segment &orig) {
// copy source
memcpy((void*)this, (void*)&orig, sizeof(Segment));
transitional = false;
#ifdef WLEDMM_FASTPATH

// WLEDMM prevent any fast draw calls to this segment until the next frame starts
//_isValid2D = false;
_isSimpleSegment = false;
_isSuperSimpleSegment = false;
#endif

// erase pointers to allocated data
name = nullptr;
data = nullptr;
Expand Down Expand Up @@ -217,11 +216,11 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
deallocateData(); // free old runtime data
if (_t) { delete _t; _t = nullptr; }
if (ledsrgb && !Segment::_globalLeds) free(ledsrgb); //WLEDMM: not needed anymore as we will use leds from copy. no need to nullify ledsrgb as it gets new value in memcpy
#ifdef WLEDMM_FASTPATH

// WLEDMM temporarily prevent any fast draw calls to old and new segment
orig._isSimpleSegment = false;
orig._isSuperSimpleSegment = false;
#endif

memcpy((void*)this, (void*)&orig, sizeof(Segment));
#ifdef WLEDMM_FASTPATH
// WLEDMM temporarily prevent any draw calls to old segment
Expand Down

0 comments on commit b47c55d

Please sign in to comment.