small fixes

very minor changes:
* HUB75 bus don't leave _len uninitialized, handle display == nullptr before using display members
* __attribute__((pure)) was in the wrong location
* wled00.ino: made lps (loops-per-second) calculation a bit more accurate
This commit is contained in:
Frank
2024-10-03 00:19:18 +02:00
parent 3a38d0cfed
commit 1e5b246871
3 changed files with 12 additions and 3 deletions

View File

@@ -527,6 +527,7 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh
_valid = false;
fourScanPanel = nullptr;
_len = 0;
mxconfig.double_buff = false; // Use our own memory-optimised buffer rather than the driver's own double-buffer
@@ -744,6 +745,11 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh
// OK, now we can create our matrix object
display = new MatrixPanel_I2S_DMA(mxconfig);
if (display == nullptr) {
USER_PRINTLN("****** MatrixPanel_I2S_DMA !KABOOM! driver allocation failed ***********");
USER_PRINT(F("heap usage: ")); USER_PRINTLN(lastHeap - ESP.getFreeHeap());
return;
}
this->_len = (display->width() * display->height());