Skip to content

Commit

Permalink
fixed wifi streaming of black zones
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Nov 22, 2024
1 parent c03bfbb commit 2bb5b0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions src/displays/LEDMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
19 changes: 8 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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) {
Expand All @@ -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;
}
}
Expand All @@ -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();
}

Expand All @@ -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) {
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 2bb5b0f

Please sign in to comment.