From 3ac749b83cf218ab151ae1ca72badd41eaf0cc49 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 6 Jan 2024 20:16:45 +0100 Subject: ssd1306: correctly initialize vertical addressing for height < 64px Fixes operation on 128x32 displays --- .reuse/dep5 | 2 +- ssd1306.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index fc8406b..716361e 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -1,7 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: framebuffer.lua ssd1306.lua -Copyright: 2022 Birte Kristina Friesel +Copyright: 2022-2024 Birte Kristina Friesel License: BSD-2-Clause Files: pixeloperator.lua diff --git a/ssd1306.lua b/ssd1306.lua index d54d28f..a6e4cd3 100644 --- a/ssd1306.lua +++ b/ssd1306.lua @@ -40,7 +40,7 @@ function ssd1306.init(width, height) s_COM_PIN_CFG, height == 32 and 0x02 or 0x12, s_DISP_CLK_DIV, 0x80, s_PRECHARGE, 0x88, s_VCOM_DESEL, 0x30, s_CONTRAST, 0x80, s_ENTIRE_ON, s_NORM_INV, s_CHARGE_PUMP, 0x14, s_DISP + 0x01, s_COL_ADDR, 0, 127, - s_PAGE_ADDR, 0, 7} + s_PAGE_ADDR, 0, height/8-1} for i, v in ipairs(tab) do ssd1306.wc(v) end -- cgit v1.2.3