Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P4 experimental #203

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
283a728
ES8311 support added for the ESP32-P4 EV board with mic.
troyhacks Oct 2, 2024
3b46af1
Make IP clickable via serial monitor
troyhacks Nov 23, 2024
37c7bb1
Update animartrix for bugfixes for corrupt state for master_speed, sp…
netmindz Nov 23, 2024
61c2ba9
HUB75 small speedup
softhack007 Nov 24, 2024
ce8fc89
const const const
softhack007 Nov 24, 2024
eb56a76
Update animartrix version with no dirty state
netmindz Nov 24, 2024
5a2096a
partly inline getPixelColorXY
softhack007 Nov 24, 2024
7ad67b5
blurz effect upgrade
softhack007 Nov 25, 2024
7d10bd0
Allow TV Simulator on single LED segments
softhack007 Nov 25, 2024
12ef7cb
Enable NON32XFER_HANDLER on ESP8266
willmmiles Oct 23, 2024
827cf87
Merge pull request #4188 from LuisFadini/0_15_brt_timezone
softhack007 Oct 13, 2024
ae07672
swirl effect bugfix
softhack007 Nov 26, 2024
ccf1b04
allow tri fade effect on 0D (single pixel)
softhack007 Nov 26, 2024
c447840
small tails for rolling balls
softhack007 Nov 27, 2024
402786c
GEQ FLat mode (1D)
softhack007 Nov 27, 2024
8ff0223
GEQ flat mode for 2D
softhack007 Nov 27, 2024
59d5ff0
Flat GEQ improvement for shorter stips
softhack007 Nov 27, 2024
f21b294
fix for effect double restart problem when cross-fade is enabled
softhack007 Nov 27, 2024
3d0ba0e
Merge branch 'mdev' into P4_experimental
troyhacks Nov 28, 2024
1670330
Octopus Radial Wave mode
softhack007 Nov 28, 2024
9046ec4
Octopus minor optimization
softhack007 Nov 28, 2024
5ea9cb1
Octopus code improvements
softhack007 Nov 28, 2024
e914417
Merge pull request #4181 from DedeHai/0_15_trig_math
DedeHai Nov 27, 2024
6c87799
post merge
softhack007 Nov 28, 2024
b2364bf
chunchun effect bugfixes (for strips >256 pixels)
softhack007 Nov 29, 2024
b0b6ec3
support for benchmarking FastLed vs. WLED triginometry
softhack007 Nov 29, 2024
9ff235e
Show "NO PSRAM" on info page
softhack007 Nov 29, 2024
a0e0376
blends effect bugfix
softhack007 Dec 1, 2024
9850d1f
Merge branch 'mdev' into P4_experimental
troyhacks Dec 2, 2024
994a9e7
Fix Color Order GUI for Art-Net
troyhacks Dec 2, 2024
796eb6e
Merge pull request #198 from troyhacks/mdev
troyhacks Dec 2, 2024
f2f621b
minor FX improvements
softhack007 Dec 3, 2024
0dbde5a
audioreactive multi-comet (backported from WELD-SR 0.13.4)
softhack007 Dec 3, 2024
9359684
Merge pull request #199 from MoonModules/FX_AudioComet
softhack007 Dec 3, 2024
9922d2a
bugfix: don't render segments that are "off"
softhack007 Dec 3, 2024
67e7829
Merge pull request #168 from troyhacks/ES8311-Support
netmindz Dec 3, 2024
23d41e6
bugfix #2 for switched-off segments
softhack007 Dec 3, 2024
86ed5a8
DNA effect: additional parameter "phases" (thanks @ewoudwijma )
softhack007 Dec 3, 2024
2bfa3b7
Merge branch 'mdev' of https://github.com/MoonModules/WLED into mdev
softhack007 Dec 3, 2024
9ea2303
DNA effect optimization (phases)
softhack007 Dec 3, 2024
f4ac04b
Update platformio.ini - fix for duplicate WLED_RELEASE_NAMEs
softhack007 Dec 3, 2024
6763ca1
Cosmetic 2D Setup change: Start at Panel 1 instead of 0
troyhacks Dec 4, 2024
e5b22bc
Cosmetic 2D Setup change: Start at Panel 1 instead of 0
troyhacks Dec 4, 2024
3dbf78a
Merge branch 'mdev' of https://github.com/troyhacks/WLED into mdev
troyhacks Dec 4, 2024
859e56a
Merge pull request #201 from troyhacks/mdev
troyhacks Dec 4, 2024
e331cc8
Merge branch 'mdev' into P4_experimental
troyhacks Dec 4, 2024
102d098
bugfix #3 for ghostly appearing switched-off segments
softhack007 Dec 4, 2024
972257a
minor code cleanup
softhack007 Dec 4, 2024
6954a15
Merge branch 'MoonModules:P4_experimental' into P4_experimental
troyhacks Dec 4, 2024
7e29d5c
Merge branch 'mdev' into P4_experimental
troyhacks Dec 8, 2024
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
7 changes: 4 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ build_flags =
; -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48 ;; in case of linker errors like "section `.text1' will not fit in region `iram1_0_seg'"
; -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED ;; (experimental) adds some extra heap, but may cause slowdown
-D USERMOD_AUDIOREACTIVE
-D NON32XFER_HANDLER ;; ask forgiveness for PROGMEM misuse

lib_deps =
#https://github.com/lorol/LITTLEFS.git
Expand Down Expand Up @@ -1144,7 +1145,7 @@ AR_build_flags = -D USERMOD_AUDIOREACTIVE -D UM_AUDIOREACTIVE_USE_NEW_FFT ;; WLE
AR_lib_deps = https://github.com/softhack007/arduinoFFT.git#develop @ 1.9.2 ;; used for USERMOD_AUDIOREACTIVE - optimized version, 10% faster on -S2/-C3

animartrix_build_flags = -D USERMOD_ANIMARTRIX ;; WLEDMM usermod: CC BY-NC 3.0 licensed effects by Stefan Petrick
animartrix_lib_deps = https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7
animartrix_lib_deps = https://github.com/netmindz/animartrix.git#657f754783268b648e1d56b3cd31c810379d0c89 ;; Dirty state fix
animartrix_lib_ignore = animartrix ;; to remove the animartrix lib dependancy (saves a few bytes)

DMXin_build_flags = -D WLED_ENABLE_DMX_INPUT ;; WLEDMM DMX physical input - requires ESP-IDF v4.4.x
Expand Down Expand Up @@ -2245,7 +2246,7 @@ board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware,
;; board_build.partitions = tools/WLED_ESP32_4MB_512KB_FS.csv ;; 1.7MB firmware, 500KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions)
build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation
${common_mm.build_flags_S}
-D WLED_RELEASE_NAME=esp32S3_4MB_S
-D WLED_RELEASE_NAME=esp32S3_4MB_PSRAM_S
-DBOARD_HAS_PSRAM ;; -D WLED_USE_PSRAM
-D WLED_USE_PSRAM_JSON -DALL_JSON_TO_PSRAM ; WLEDMM --> force all JSON stuff into PSRAM; gives more free heap
-DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - allows some buffers to use PSRAM
Expand Down Expand Up @@ -2283,7 +2284,7 @@ board = lolin_s3_mini ;; -S3 mini: 4MB flash 2MB PSRAM
board_build.partitions = ${esp32.default_partitions}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation
${common_mm.build_flags_S} ${common_mm.build_flags_M}
-D WLED_RELEASE_NAME=esp32S3_4MB_M
-D WLED_RELEASE_NAME=esp32S3_4MB_PSRAM_M
-DBOARD_HAS_PSRAM ;; -D WLED_USE_PSRAM
-D WLED_USE_PSRAM_JSON -DALL_JSON_TO_PSRAM ; WLEDMM --> force all JSON stuff into PSRAM; gives more free heap
-DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - allows some buffers to use PSRAM
Expand Down
4 changes: 2 additions & 2 deletions usermods/Analog_Clock/Analog_Clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class AnalogClockUsermod : public Usermod {

void secondsEffectSineFade(int16_t secondLed, Toki::Time const& time) {
uint32_t ms = time.ms % 1000;
uint8_t b0 = (cos8(ms * 64 / 1000) - 128) * 2;
uint8_t b0 = (cos8_t(ms * 64 / 1000) - 128) * 2;
setPixelColor(secondLed, gamma32(scale32(secondColor, b0)));
uint8_t b1 = (sin8(ms * 64 / 1000) - 128) * 2;
uint8_t b1 = (sin8_t(ms * 64 / 1000) - 128) * 2;
setPixelColor(inc(secondLed, 1, secondsSegment), gamma32(scale32(secondColor, b1)));
}

Expand Down
619 changes: 370 additions & 249 deletions wled00/FX.cpp

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ bool strip_uses_global_leds(void) __attribute__((pure)); // WLEDMM implemented
// Experimental Audioresponsive modes from WLED-SR
// #define FX_MODE_3DSphereMove 189 // experimental WLED-SR "cube" mode
#define FX_MODE_POPCORN_AR 190 // WLED-SR audioreactive popcorn
// #define FX_MODE_MULTI_COMET_AR 191 // WLED-SR audioreactive multi-comet
#define FX_MODE_MULTI_COMET_AR 191 // WLED-SR audioreactive multi-comet
#define FX_MODE_STARBURST_AR 192 // WLED-SR audioreactive fireworks starburst
// #define FX_MODE_PALETTE_AR 193 // WLED-SR audioreactive palette
#define FX_MODE_FIREWORKS_AR 194 // WLED-SR audioreactive fireworks
Expand Down Expand Up @@ -380,6 +380,7 @@ typedef struct Segment {
};
uint8_t grouping, spacing;
uint8_t opacity;
uint8_t lastBri; // WLEDMM optimization for black-to-black "transitions"
bool needsBlank; // WLEDMM indicates that Segment needs to be blanked (due to change of mirror / reverse / transpose / spacing)
uint32_t colors[NUM_COLORS];
uint8_t cct; //0==1900K, 255==10091K
Expand Down Expand Up @@ -420,15 +421,14 @@ typedef struct Segment {
};
size_t _dataLen; // WLEDMM uint16_t is too small
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!!!
void setPixelColorXY_fast(int x, int y,uint32_t c, uint32_t scaled_col, int cols, int rows) const; // 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 _isValid2D = false;
uint8_t _brightness = 255; // final pixel brightness - including transitions and segment opacity
bool _firstFill = true; // dirty HACK support
uint16_t _2dWidth = 0; // virtualWidth
uint16_t _2dHeight = 0; // virtualHeight
uint16_t _virtuallength = 0; // virtualLength
Expand Down Expand Up @@ -490,6 +490,7 @@ typedef struct Segment {
grouping(1),
spacing(0),
opacity(255),
lastBri(255),
needsBlank(false),
colors{DEFAULT_COLOR,BLACK,BLACK},
cct(127),
Expand Down Expand Up @@ -606,7 +607,7 @@ typedef struct Segment {
// transition functions
void startTransition(uint16_t dur); // transition has to start before actual segment values change
void handleTransition(void);
uint16_t progress(void); //transition progression between 0-65535
uint16_t progress(void) const; //transition progression between 0-65535

// WLEDMM method inlined for speed (its called at each setPixelColor)
inline uint8_t currentBri(uint8_t briNew, bool useCct = false) {
Expand All @@ -621,7 +622,7 @@ typedef struct Segment {

uint8_t currentMode(uint8_t modeNew);
uint32_t currentColor(uint8_t slot, uint32_t colorNew);
CRGBPalette16 &loadPalette(CRGBPalette16 &tgt, uint8_t pal);
CRGBPalette16 &loadPalette(CRGBPalette16 &tgt, uint8_t pal) const;
void setCurrentPalette(void);

// 1D strip
Expand Down Expand Up @@ -721,10 +722,21 @@ typedef struct Segment {

uint32_t scaled_col = (_brightness == 255) ? col : color_fade(col, _brightness); // calculate final color
setPixelColorXY_fast(x, y, col, scaled_col, int(_2dWidth), int(_2dHeight)); // call "fast" function
}
}
}
}
inline uint32_t getPixelColorXY(int x, int y) const {
// minimal sanity checks
if (!_isValid2D) return 0; // not active
if ((unsigned(x) >= _2dWidth) || (unsigned(y) >= _2dHeight)) return 0 ; // check if (x,y) are out-of-range - due to 2's complement, this also catches negative values
if (ledsrgb) {
int i = x + y*_2dWidth; // avoid error checking done by XY() - be optimistic about ranges of x and y
return RGBW32(ledsrgb[i].r, ledsrgb[i].g, ledsrgb[i].b, 0);
}
else return getPixelColorXY_part2(x, y, int(_2dWidth), int(_2dHeight)); // call "no ledsrgb" function to retrieve pixel from bus driver
}
#else
void setPixelColorXY(int x, int y, uint32_t c); // set relative pixel within segment with color
uint32_t __attribute__((pure)) getPixelColorXY(int x, int y) const { return getPixelColorXY_slow(x,y);}
#endif
inline void setPixelColorXY(unsigned x, unsigned y, uint32_t c) { setPixelColorXY(int(x), int(y), c); }
inline void setPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0) { setPixelColorXY(x, y, RGBW32(r,g,b,w)); }
Expand All @@ -735,7 +747,8 @@ typedef struct Segment {
inline void setPixelColorXY(float x, float y, byte r, byte g, byte b, byte w = 0, bool aa = true) { setPixelColorXY(x, y, RGBW32(r,g,b,w), aa); }
inline void setPixelColorXY(float x, float y, CRGB c, bool aa = true) { setPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), aa); }
//#endif
uint32_t __attribute__((pure)) getPixelColorXY(int x, int y) const;
uint32_t __attribute__((pure)) getPixelColorXY_part2(int x, int y, int cols, int rows) const;
uint32_t __attribute__((pure)) getPixelColorXY_slow(int x, int y) const;
// 2D support functions
void blendPixelColorXY(uint16_t x, uint16_t y, uint32_t color, uint8_t blend);
inline void blendPixelColorXY(uint16_t x, uint16_t y, CRGB c, uint8_t blend) { blendPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), blend); }
Expand Down
21 changes: 14 additions & 7 deletions wled00/FX_2Dfcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ void Segment::startFrame(void) {
_2dHeight = calc_virtualHeight();
_2dWidth = _isValid2D ? calc_virtualWidth() : calc_virtualLength();
_virtuallength = calc_virtualLength();
#if 0 && defined(WLED_ENABLE_HUB75MATRIX)
_firstFill = true; // dirty HACK
#endif
#endif
}
// WLEDMM end
Expand All @@ -283,7 +280,7 @@ void Segment::startFrame(void) {

// Simplified version of Segment::setPixelColorXY - without error checking. Does not support grouping or spacing
// * expects scaled color (final brightness) as additional input parameter, plus segment virtualWidth() and virtualHeight()
void IRAM_ATTR __attribute__((hot)) Segment::setPixelColorXY_fast(int x, int y, uint32_t col, uint32_t scaled_col, int cols, int rows) //WLEDMM
void IRAM_ATTR __attribute__((hot)) Segment::setPixelColorXY_fast(int x, int y, uint32_t col, uint32_t scaled_col, int cols, int rows) const //WLEDMM
{
unsigned i = UINT_MAX;
bool sameColor = false;
Expand Down Expand Up @@ -413,7 +410,7 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa, bool fast
if (Segment::maxHeight==1) return; // not a matrix set-up
if (x<0.0f || x>1.0f || y<0.0f || y>1.0f) return; // not normalized

#if 0 // depricated
#if 0 // deprecated
const uint_fast16_t cols = virtualWidth();
const uint_fast16_t rows = virtualHeight();

Expand Down Expand Up @@ -465,8 +462,18 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa, bool fast
#endif
}

// returns RGBW values of pixel
uint32_t IRAM_ATTR_YN Segment::getPixelColorXY(int x, int y) const {
// WLEDMM this function is only called by getPixelColorXY, in case we don't have the ledsrgb buffer!
uint32_t IRAM_ATTR_YN Segment::getPixelColorXY_part2(int x, int y, int cols, int rows) const {
if (reverse ) x = cols - x - 1;
if (reverse_y) y = rows - y - 1;
if (transpose) std::swap(x,y); // swap X & Y if segment transposed
const uint_fast16_t groupLength_ = groupLength(); // WLEDMM small optimization
x *= groupLength_; // expand to physical pixels
y *= groupLength_; // expand to physical pixels
return strip.getPixelColorXYRestored(start + x, startY + y);
}

uint32_t IRAM_ATTR_YN Segment::getPixelColorXY_slow(int x, int y) const { // WLEDMM fallback for non-fastpath builds
if (x<0 || y<0 || !isActive()) return 0; // not active or out-of range
if (ledsrgb) {
int i = XY(x,y);
Expand Down
30 changes: 11 additions & 19 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void Segment::setUpLeds() {
}
}

CRGBPalette16 &Segment::loadPalette(CRGBPalette16 &targetPalette, uint8_t pal) {
CRGBPalette16 &Segment::loadPalette(CRGBPalette16 &targetPalette, uint8_t pal) const {
static unsigned long _lastPaletteChange = millis() - 990000; // perhaps it should be per segment //WLEDMM changed init value to avoid pure orange after startup
static CRGBPalette16 randomPalette = CRGBPalette16(DEFAULT_COLOR);
static CRGBPalette16 prevRandomPalette = CRGBPalette16(CRGB(BLACK));
Expand Down Expand Up @@ -462,7 +462,7 @@ void Segment::startTransition(uint16_t dur) {
}

// transition progression between 0-65535
uint16_t IRAM_ATTR_YN Segment::progress() {
uint16_t IRAM_ATTR_YN Segment::progress() const {
if (!transitional || !_t) return 0xFFFFU;
unsigned long timeNow = millis();
if (timeNow - _t->_start > _t->_dur || _t->_dur == 0) return 0xFFFFU;
Expand Down Expand Up @@ -504,12 +504,12 @@ void Segment::setCurrentPalette() {
}

void Segment::handleTransition() {
if (!transitional) return;
if (!transitional || !_t) return; // Early exit if no transition active
unsigned long maxWait = millis() + 20;
if (mode == FX_MODE_STATIC && next_time > maxWait) next_time = maxWait;
if (progress() == 0xFFFFU) {
if (_t) {
if (_t->_modeP != mode) markForReset();
//if (_t->_modeP != mode) markForReset(); // WLEDMM effect transition disabled as it does not work (flashes due to double effect restart)
delete _t;
_t = nullptr;
}
Expand Down Expand Up @@ -561,7 +561,7 @@ bool Segment::setColor(uint8_t slot, uint32_t c) { //returns true if changed
if (slot == 0 && c == BLACK) return false; // on/off segment cannot have primary color black
if (slot == 1 && c != BLACK) return false; // on/off segment cannot have secondary color non black
}
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change // WLEDMM only on real change
colors[slot] = c;
stateChanged = true; // send UDP/WS broadcast
return true;
Expand All @@ -574,7 +574,7 @@ void Segment::setCCT(uint16_t k) {
k = (k - 1900) >> 5;
}
if (cct == k) return;
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change
cct = k;
stateChanged = true; // send UDP/WS broadcast
}
Expand Down Expand Up @@ -628,7 +628,7 @@ void Segment::setMode(uint8_t fx, bool loadDefaults, bool sliderDefaultsOnly) {
sOpt = extractModeDefaults(fx, "pal"); if (sOpt >= 0) {if (oldPalette==-1) oldPalette = palette; setPalette(sOpt);} else {if (oldPalette!=-1) setPalette(oldPalette); oldPalette = -1;}
}
}
if (!fadeTransition) markForReset(); // WLEDMM quickfix for effect "double startup" bug. -> only works when "Crossfade" is disabled (led settings)
/*if (!fadeTransition)*/ markForReset(); // WLEDMM quickfix for effect "double startup" bug.
stateChanged = true; // send UDP/WS broadcast
}
}
Expand All @@ -638,7 +638,7 @@ void Segment::setPalette(uint8_t pal) {
if (pal < 245 && pal > GRADIENT_PALETTE_COUNT+13) pal = 0; // built in palettes
if (pal > 245 && (strip.customPalettes.size() == 0 || 255U-pal > strip.customPalettes.size()-1)) pal = 0; // custom palettes
if (pal != palette) {
if (strip.paletteFade) startTransition(strip.getTransition());
if (strip.paletteFade && on) startTransition(strip.getTransition());
palette = pal;
stateChanged = true; // send UDP/WS broadcast
}
Expand Down Expand Up @@ -1408,17 +1408,6 @@ void Segment::refreshLightCapabilities() {
*/
void __attribute__((hot)) Segment::fill(uint32_t c) {
if (!isActive()) return; // not active

#if 0 && defined(WLED_ENABLE_HUB75MATRIX) && defined(WLEDMM_FASTPATH)
// DIRTY HACK - this ignores the first fill(black) in each frame, knowing that HUB75 has already blanked out the display.
if (_firstFill) {
_firstFill = false;
if (c == BLACK) {
if (ledsrgb && ledsrgbSize > 0) memset(ledsrgb, 0, ledsrgbSize);
return;
}
}
#endif

const uint_fast16_t cols = is2D() ? virtualWidth() : virtualLength(); // WLEDMM use fast int types
const uint_fast16_t rows = virtualHeight(); // will be 1 for 1D
Expand Down Expand Up @@ -1922,6 +1911,7 @@ void WS2812FX::service() {
seg.resetIfRequired();

if (!seg.isActive()) continue;
if (!seg.on && !seg.transitional) continue; // WLEDMM skip disabled segments, unless a crossfade is ongoing

// last condition ensures all solid segments are updated at the same time
if(nowUp >= seg.next_time || _triggered || (doShow && seg.mode == FX_MODE_STATIC)) // WLEDMM ">=" instead of ">"
Expand All @@ -1943,6 +1933,7 @@ void WS2812FX::service() {
now = millis() + timebase;
#endif
seg.startFrame(); // WLEDMM
if (!_triggered && (seg.currentBri(seg.opacity) == 0) && (seg.lastBri == 0)) continue; // WLEDMM skip totally black segments
// effect blending (execute previous effect)
// actual code may be a bit more involved as effects have runtime data including allocated memory
//if (seg.transitional && seg._modeP) (*_mode[seg._modeP])(progress());
Expand All @@ -1952,6 +1943,7 @@ void WS2812FX::service() {
if (seg.mode != FX_MODE_HALLOWEEN_EYES) seg.call++;
if (seg.transitional && frameDelay > FRAMETIME) frameDelay = FRAMETIME; // force faster updates during transition

seg.lastBri = seg.currentBri(seg.on ? seg.opacity:0); // WLEDMM remember for next time
seg.handleTransition();
}

Expand Down
12 changes: 6 additions & 6 deletions wled00/bus_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh
USER_PRINT(F("heap usage: ")); USER_PRINTLN(int(lastHeap - ESP.getFreeHeap()));
}

void __attribute__((hot)) BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c) {
void __attribute__((hot)) IRAM_ATTR BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c) {
if (!_valid || pix >= _len) return;
// if (_cct >= 1900) c = colorBalanceFromKelvin(_cct, c); //color correction from CCT

Expand Down Expand Up @@ -1104,12 +1104,12 @@ void __attribute__((hot)) BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c
#endif
}

uint32_t BusHub75Matrix::getPixelColor(uint16_t pix) const {
uint32_t IRAM_ATTR BusHub75Matrix::getPixelColor(uint16_t pix) const {
if (!_valid || pix >= _len || !_ledBuffer) return BLACK;
return uint32_t(_ledBuffer[pix].scale8(_bri)) & 0x00FFFFFF; // scale8() is needed to mimic NeoPixelBus, which returns scaled-down colours
}

uint32_t __attribute__((hot)) BusHub75Matrix::getPixelColorRestored(uint16_t pix) const {
uint32_t __attribute__((hot)) IRAM_ATTR BusHub75Matrix::getPixelColorRestored(uint16_t pix) const {
if (!_valid || pix >= _len || !_ledBuffer) return BLACK;
return uint32_t(_ledBuffer[pix]) & 0x00FFFFFF;
}
Expand All @@ -1124,7 +1124,7 @@ void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) {
if (display) display->setBrightness(_bri);
}

void __attribute__((hot)) BusHub75Matrix::show(void) {
void __attribute__((hot)) IRAM_ATTR BusHub75Matrix::show(void) {
if (!_valid) return;
MatrixPanel_I2S_DMA* display = BusHub75Matrix::activeDisplay;
if (!display) return;
Expand Down Expand Up @@ -1284,8 +1284,8 @@ void BusManager::removeAll() {
lastend = 0;
}

void BusManager::show() {
for (uint8_t i = 0; i < numBusses; i++) {
void __attribute__((hot)) BusManager::show() {
for (unsigned i = 0; i < numBusses; i++) {
busses[i]->show();
}
}
Expand Down
2 changes: 1 addition & 1 deletion wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class Bus {
inline static void setGlobalAWMode(uint8_t m) { if (m < 5) _gAWM = m; else _gAWM = AW_GLOBAL_DISABLED; }
inline static uint8_t getGlobalAWMode() { return _gAWM; }

inline uint32_t restore_Color_Lossy(uint32_t c, uint8_t restoreBri) const { // shamelessly grabbed from upstream, who grabbed from NPB, who ..
inline static uint32_t restore_Color_Lossy(uint32_t c, uint8_t restoreBri) { // shamelessly grabbed from upstream, who grabbed from NPB, who ..
if (restoreBri < 255) {
uint8_t* chan = (uint8_t*) &c;
for (uint_fast8_t i=0; i<4; i++) {
Expand Down
Loading
Loading