From 1ea980ee86c0c40ab2b1d06d04eaf876d31968b0 Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Tue, 21 Jul 2026 19:57:01 +0200 Subject: [PATCH 1/2] if someone configured 128x16 as panel layout, force 128x32. --- src/ZeDMD.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ZeDMD.cpp b/src/ZeDMD.cpp index f4e6714..c662de5 100644 --- a/src/ZeDMD.cpp +++ b/src/ZeDMD.cpp @@ -731,10 +731,12 @@ bool ZeDMD::Open(uint16_t width, uint16_t height) bool ZeDMD::OpenSpi(uint32_t speed, uint8_t framePause, uint16_t width, uint16_t height) { + uint16_t realHeight = height == 16 ? 32 : height; // 128x16 is rendered as 128x32 + m_pZeDMDSpi->SetSpeed(speed); m_pZeDMDSpi->SetFramePause(framePause); m_pZeDMDSpi->SetWidth(width); - m_pZeDMDSpi->SetHeight(height); + m_pZeDMDSpi->SetHeight(realHeight); m_spi = m_pZeDMDSpi->Connect(); @@ -745,7 +747,7 @@ bool ZeDMD::OpenSpi(uint32_t speed, uint8_t framePause, uint16_t width, uint16_t m_pFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); m_pScaledFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); - m_pRgb565Buffer = (uint8_t*)malloc(width * height * 2); + m_pRgb565Buffer = (uint8_t*)malloc(width * realHeight * 2); m_pZeDMDSpi->Run(); } From 0dffdba8a83c8e546d6794f37d76edf009bc0c7b Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Tue, 21 Jul 2026 20:21:21 +0200 Subject: [PATCH 2/2] revert --- src/ZeDMD.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ZeDMD.cpp b/src/ZeDMD.cpp index c662de5..f4e6714 100644 --- a/src/ZeDMD.cpp +++ b/src/ZeDMD.cpp @@ -731,12 +731,10 @@ bool ZeDMD::Open(uint16_t width, uint16_t height) bool ZeDMD::OpenSpi(uint32_t speed, uint8_t framePause, uint16_t width, uint16_t height) { - uint16_t realHeight = height == 16 ? 32 : height; // 128x16 is rendered as 128x32 - m_pZeDMDSpi->SetSpeed(speed); m_pZeDMDSpi->SetFramePause(framePause); m_pZeDMDSpi->SetWidth(width); - m_pZeDMDSpi->SetHeight(realHeight); + m_pZeDMDSpi->SetHeight(height); m_spi = m_pZeDMDSpi->Connect(); @@ -747,7 +745,7 @@ bool ZeDMD::OpenSpi(uint32_t speed, uint8_t framePause, uint16_t width, uint16_t m_pFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); m_pScaledFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); - m_pRgb565Buffer = (uint8_t*)malloc(width * realHeight * 2); + m_pRgb565Buffer = (uint8_t*)malloc(width * height * 2); m_pZeDMDSpi->Run(); }