HUB75: fix for crash on -S3

* use a fork of the HUB75 with fixed Bus_Parallel16::release()
* prevent accessing an invalid display object
This commit is contained in:
Frank
2024-10-11 21:19:22 +02:00
parent 98bdbd1eb2
commit 54467473f8
2 changed files with 4 additions and 2 deletions

View File

@@ -1072,7 +1072,8 @@ HUB75_build_flags =
-D NO_CIE1931 ;; Do not use LED brightness compensation described in CIE 1931. We use FastLED dimming already
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
-D WLEDMM_SLOWPATH ;; WLEDMM: do not use I2S for driving ws2812 LEDs (HUB75 driver needs I2S#1)
HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a9 ;; S3_LCD_DIV_NUM fix
;; HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a9 ;; S3_LCD_DIV_NUM fix
HUB75_lib_deps = https://github.com/softhack007/ESP32-HUB75-MatrixPanel-DMA_sh7.git#fix_dangling_pointer ;; S3 bugfix for crash in ~MatrixPanel_I2S_DMA()
HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes)
NetDebug_build_flags =

View File

@@ -916,6 +916,7 @@ uint32_t __attribute__((hot)) BusHub75Matrix::getPixelColorRestored(uint16_t pix
void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) {
_bri = b;
if (!_valid) return;
// if (_bri > 238) _bri=238; // not strictly needed. Enable this line if you see glitches at highest brightness.
display->setBrightness(_bri);
}
@@ -967,7 +968,7 @@ void BusHub75Matrix::cleanup() {
USER_PRINTLN("HUB75 output ended.");
//if (fourScanPanel != nullptr) delete fourScanPanel; // warning: deleting object of polymorphic class type 'VirtualMatrixPanel' which has non-virtual destructor might cause undefined behavior
delete display;
if (display) delete display;
display = nullptr;
fourScanPanel = nullptr;
if (_ledBuffer != nullptr) free(_ledBuffer); _ledBuffer = nullptr;