Merge remote-tracking branch 'upstream/main' into mdev

This commit is contained in:
Frank
2023-05-21 14:53:49 +02:00
parent ef12aaa60b
commit 894fdce4b5
4 changed files with 46 additions and 28 deletions

View File

@@ -206,13 +206,13 @@ void Segment::setUpLeds() {
#else
leds = &Segment::_globalLeds[start];
#endif
else if (!leds) {
#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && defined(WLED_USE_PSRAM)
if (psramFound())
leds = (CRGB*)ps_malloc(sizeof(CRGB)*10000); // WLEDMM: stupid - PSRAM is too slow for this !!!
else
#endif
leds = (CRGB*)malloc(sizeof(CRGB)*10000);
else if ((leds == nullptr) /*&& (length() > 0)*/) { //softhack007 quickfix - avoid malloc(0) which is undefined behaviour (should not happen, but i've seen it)
//#if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && defined(WLED_USE_PSRAM)
//if (psramFound())
// leds = (CRGB*)ps_malloc(sizeof(CRGB)*10000 /*length()*/); // softhack007 disabled; putting leds into psram leads to horrible slowdown on WROVER boards
//else
//#endif
leds = (CRGB*)malloc(sizeof(CRGB)*10000 /*length()*/);
}
}