summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-06 20:16:45 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-06 20:16:45 +0100
commit3ac749b83cf218ab151ae1ca72badd41eaf0cc49 (patch)
treefcb6682d8057e72f7e420211a2dd76dd8ee0769b
parentaab0d144c8f8479aa43e69d1be8e224371f9d524 (diff)
ssd1306: correctly initialize vertical addressing for height < 64pxHEADmain
Fixes operation on 128x32 displays
-rw-r--r--.reuse/dep52
-rw-r--r--ssd1306.lua2
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