From 577e329809c9470c3fe183f6cebbfcf4d87685e2 Mon Sep 17 00:00:00 2001 From: "Lukas F. Hartmann" Date: Fri, 26 Aug 2022 17:07:21 +0200 Subject: [PATCH] HID: fix display width --- pocket-reform-keyboard-fw/pocket-hid/src/oled.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pocket-reform-keyboard-fw/pocket-hid/src/oled.c b/pocket-reform-keyboard-fw/pocket-hid/src/oled.c index f9fda60..81e886e 100644 --- a/pocket-reform-keyboard-fw/pocket-hid/src/oled.c +++ b/pocket-reform-keyboard-fw/pocket-hid/src/oled.c @@ -263,7 +263,7 @@ void matrix_render(struct CharacterMatrix *matrix) { send_cmd3(PageAddr, 0, MatrixRows - 1); send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); - uint8_t buf[1 + MatrixRows * MatrixCols]; + uint8_t buf[1 + MatrixRows * MatrixCols * FontWidth]; buf[0] = 0x40; int i = 1; @@ -279,7 +279,7 @@ void matrix_render(struct CharacterMatrix *matrix) { } } } - i2c_write_blocking(i2c0, SSD1306_ADDRESS, buf, 1 + MatrixRows * MatrixCols, false); + i2c_write_blocking(i2c0, SSD1306_ADDRESS, buf, 1 + MatrixRows * MatrixCols * FontWidth, false); matrix->dirty = false; done: