From 9734ac8b56dfeb5c0cefcce0dc23171e3896b038 Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Thu, 21 Dec 2023 16:59:45 +0100 Subject: [PATCH 1/2] Zone rendering for 128x32 --- platformio.ini | 4 ++-- src/main.cpp | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index 46be150..ede06cb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,7 +23,7 @@ lib_deps = thomasfredericks/Bounce2 build_flags = -DNO_GFX=1 - -DPIXEL_COLOR_DEPTH_BITS=8 + -DPIXEL_COLOR_DEPTH_BITS=7 -DMINIZ_NO_STDIO=1 -DMINIZ_NO_TIME=1 -DMINIZ_NO_DEFLATE_APIS=1 @@ -65,7 +65,7 @@ lib_deps = build_flags = -DNO_GFX=1 -DZEDMD_WIFI=1 - -DPIXEL_COLOR_DEPTH_BITS=8 + -DPIXEL_COLOR_DEPTH_BITS=7 -DMINIZ_NO_STDIO=1 -DMINIZ_NO_TIME=1 -DMINIZ_NO_DEFLATE_APIS=1 diff --git a/src/main.cpp b/src/main.cpp index 4935492..828de89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,9 +71,11 @@ #define TOTAL_WIDTH_PLANE (TOTAL_WIDTH >> 3) #define TOTAL_HEIGHT PANEL_HEIGHT #define TOTAL_BYTES (TOTAL_WIDTH * TOTAL_HEIGHT * 3) -#define ZONES_PER_ROW (TOTAL_WIDTH / 16) -#define TOTAL_ZONES ((TOTAL_HEIGHT / 8) * ZONES_PER_ROW) -#define ZONE_SIZE (16 * 8 * 3) +#define ZONE_WIDTH (TOTAL_WIDTH / 16) +#define ZONE_HEIGHT (TOTAL_HEIGHT / 8) +#define ZONES_PER_ROW (TOTAL_WIDTH / ZONE_WIDTH) +#define TOTAL_ZONES ((TOTAL_HEIGHT / ZONE_HEIGHT) * ZONES_PER_ROW) +#define ZONE_SIZE (ZONE_WIDTH * ZONE_HEIGHT * 3) #define MAX_COLOR_ROTATIONS 8 #define LED_CHECK_DELAY 1000 // ms per color @@ -610,14 +612,14 @@ void ScaleImage(uint8_t colors) void fillZoneRaw(uint8_t idx, uint8_t *pBuffer) { - uint8_t yOffset = (idx / ZONES_PER_ROW) * 8; - uint8_t xOffset = (idx % ZONES_PER_ROW) * 16; + uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT; + uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH; - for (uint8_t y = 0; y < 8; y++) + for (uint8_t y = 0; y < ZONE_HEIGHT; y++) { - for (uint8_t x = 0; x < 16; x++) + for (uint8_t x = 0; x < ZONE_WIDTH; x++) { - uint16_t pos = (y * 16 + x) * 3; + uint16_t pos = (y * ZONE_WIDTH + x) * 3; dma_display->drawPixelRGB888( x + xOffset, From ce52fbc8372bc94dc66dcbba6459e6dce7f26ff0 Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Thu, 21 Dec 2023 17:06:47 +0100 Subject: [PATCH 2/2] disabled mode on wifi --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 828de89..a884021 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1547,6 +1547,7 @@ void loop() break; } +#if !defined(ZEDMD_WIFI) case 4: // mode RGB24 zones streaming { renderBuffer = (uint8_t *)malloc(TOTAL_ZONES * ZONE_SIZE + ZONES_PER_ROW); @@ -1565,6 +1566,7 @@ void loop() free(renderBuffer); break; } +#endif #if !defined(ZEDMD_WIFI) && !defined(ZEDMD_HD) case 3: // mode RGB24