From 5cdfcb08fbcaca99c92c157eb929a38ddf6415bb Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 15 Jun 2020 12:47:22 +0100 Subject: working 2nd display --- app/font8x16.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'app/font8x16.c') diff --git a/app/font8x16.c b/app/font8x16.c index 48358f8..3591129 100644 --- a/app/font8x16.c +++ b/app/font8x16.c @@ -516,7 +516,7 @@ static uint8_t font8x16[][16] = { }; void -font8x16_put_ch (unsigned ch, unsigned x, unsigned y) +font8x16_put_ch (uint8_t * vram, unsigned ch, unsigned x, unsigned y) { unsigned shift = y & 7; unsigned page = y >> 3; @@ -524,7 +524,7 @@ font8x16_put_ch (unsigned ch, unsigned x, unsigned y) x += page * SSD1306_WIDTH; - oled_blit_strip (x, x + 8, 0xff << shift, shift, font8x16[ch]); + oled_blit_strip (vram, x, x + 8, 0xff << shift, shift, font8x16[ch]); x += SSD1306_WIDTH; @@ -533,18 +533,19 @@ font8x16_put_ch (unsigned ch, unsigned x, unsigned y) if (shift) { - oled_blit_strip (x, x + 8, mask, -shift, font8x16[ch]); + oled_blit_strip (vram, x, x + 8, mask, -shift, font8x16[ch]); } shift = y & 7; - oled_blit_strip (x, x + 8, ~mask & (0xff << shift), shift, + oled_blit_strip (vram, x, x + 8, ~mask & (0xff << shift), shift, &font8x16[ch][8]); if (shift) { x += SSD1306_WIDTH; shift = 8 - shift; - oled_blit_strip (x, x + 8, 0xff >> shift, -shift, &font8x16[ch][8]); + oled_blit_strip (vram, x, x + 8, 0xff >> shift, -shift, + &font8x16[ch][8]); } @@ -552,11 +553,11 @@ font8x16_put_ch (unsigned ch, unsigned x, unsigned y) void -font8x16_put_str (char *str, unsigned x, unsigned y) +font8x16_put_str (uint8_t * vram, char *str, unsigned x, unsigned y) { while (*str) { - font8x16_put_ch (*(str++), x, y); + font8x16_put_ch (vram, *(str++), x, y); x += 8; } } -- cgit v1.2.3