reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

commit a9abcb609d97cd1d7a7893a9887d65b12881ae05
parent 6378561aaefe8adcffdbd3d861f0d55e80925d28
Author: Valtteri Koskivuori <vkoskiv@gmail.com>
Date:   Tue,  3 Oct 2023 18:26:59 +0300

Fix kbdgfx demo to use full 128px of OLED

The 'xWBIT' now supports addressing the full width, so update the demo
to match it.

Diffstat:
Mreform2-keyboard-fw/kbdgfx-demo/kbdgfx.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/reform2-keyboard-fw/kbdgfx-demo/kbdgfx.c b/reform2-keyboard-fw/kbdgfx-demo/kbdgfx.c @@ -12,11 +12,11 @@ #include <unistd.h> #define ROWS 4 -#define COLS 126 +#define COLS 128 #define BUFSZ (5+COLS*ROWS) #define FBUFSZ COLS*ROWS*8 -// our unpacked, wasteful framebuffer (one byte per pixel, 126x32) +// our unpacked, wasteful framebuffer (one byte per pixel, 128x32) uint8_t fb[FBUFSZ]; // the buffer we're sending to the keyboard (bit packed and column byte order) @@ -58,8 +58,8 @@ void fill_pattern(uint8_t bitpattern, uint8_t* dst) { } void draw_sine(float t, uint8_t* dst) { - for (int x=0; x<126; x++) { - int y = 16 + sin(t + ((float)x/126.0 * 3.141))*12; + for (int x=0; x<128; x++) { + int y = 16 + sin(t + ((float)x/128.0 * 3.141))*12; if (y < 0) y = 0; if (y > 31) y = 31;