From 2bb5b0fa40260e0eaed70e6f93068920d92baf55 Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Fri, 22 Nov 2024 18:10:33 +0100 Subject: [PATCH] fixed wifi streaming of black zones --- src/displays/LEDMatrix.cpp | 3 +++ src/main.cpp | 19 ++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/displays/LEDMatrix.cpp b/src/displays/LEDMatrix.cpp index 45e8d13..a6a0711 100644 --- a/src/displays/LEDMatrix.cpp +++ b/src/displays/LEDMatrix.cpp @@ -25,6 +25,9 @@ LedMatrix::LedMatrix() { HUB75_I2S_CFG mxconfig(PANEL_WIDTH, PANEL_HEIGHT, PANELS_NUMBER, pins); // Without setting clkphase to false, HD panels seem to flicker. mxconfig.clkphase = false; + mxconfig.latch_blanking = 2; + mxconfig.min_refresh_rate = 30; + mxconfig.driver = HUB75_I2S_CFG::shift_driver::SHIFTREG; dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); diff --git a/src/main.cpp b/src/main.cpp index d57aa86..c5aa4f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -848,7 +848,7 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { #endif if (renderBuffer == nullptr) { display->DisplayText("Error, out of memory:", 4, 6, 255, 255, 255); - display->DisplayText("HandlePacket", 4, 14, 255, 255, 255); + display->DisplayText("HandlePacket 4", 4, 14, 255, 255, 255); RestartAfterError(); } @@ -860,8 +860,7 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { mz_uncompress2(renderBuffer, &uncompressedBufferSize, &pPacket[4], (mz_ulong *)&udpPayloadSize); - if (minizStatus != MZ_OK || - uncompressedBufferSize != (ZONE_SIZE * numZones + numZones)) { + if (minizStatus != MZ_OK) { free(renderBuffer); DisplayDebugInfo(); if (debugDelayOnError) { @@ -879,8 +878,8 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { if (renderBuffer[renderBufferPosition] >= 128) { display->ClearZone(renderBuffer[renderBufferPosition++] - 128); } else { - display->FillZoneRaw(renderBuffer[renderBufferPosition], - &renderBuffer[++renderBufferPosition]); + display->FillZoneRaw(renderBuffer[renderBufferPosition++], + &renderBuffer[renderBufferPosition]); renderBufferPosition += ZONE_SIZE; } } @@ -905,7 +904,7 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { if (renderBuffer == nullptr) { display->DisplayText("Error, out of memory:", 4, 6, 255, 255, 255); - display->DisplayText("HandlePacket", 4, 14, 255, 255, 255); + display->DisplayText("HandlePacket 5", 4, 14, 255, 255, 255); RestartAfterError(); } @@ -918,9 +917,7 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { mz_uncompress2(renderBuffer, &uncompressedBufferSize, &pPacket[4], (mz_ulong *)&udpPayloadSize); - if (minizStatus != MZ_OK || - uncompressedBufferSize != - (RGB565_ZONE_SIZE * numZones + numZones)) { + if (minizStatus != MZ_OK) { free(renderBuffer); DisplayDebugInfo(); if (debugDelayOnError) { @@ -938,8 +935,8 @@ void IRAM_ATTR HandlePacket(AsyncUDPPacket packet) { if (renderBuffer[renderBufferPosition] >= 128) { display->ClearZone(renderBuffer[renderBufferPosition++] - 128); } else { - display->FillZoneRaw565(renderBuffer[renderBufferPosition], - &renderBuffer[++renderBufferPosition]); + display->FillZoneRaw565(renderBuffer[renderBufferPosition++], + &renderBuffer[renderBufferPosition]); renderBufferPosition += RGB565_ZONE_SIZE; } }