From 4ced1453cee7a3131459040efd57f73bfc77aece Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 15 Jun 2020 14:02:42 +0100 Subject: guage code --- app/font8x8.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'app/font8x8.c') diff --git a/app/font8x8.c b/app/font8x8.c index 4d49aa7..629a565 100644 --- a/app/font8x8.c +++ b/app/font8x8.c @@ -260,7 +260,7 @@ static uint8_t font8x8[][8] = { }; void -font8x8_put_ch (uint8_t * vram, unsigned ch, unsigned x, unsigned y) +font8x8_put_ch (uint8_t *vram, unsigned ch, unsigned x, unsigned y) { unsigned shift = y & 7; unsigned page = y >> 3; @@ -269,22 +269,20 @@ font8x8_put_ch (uint8_t * vram, unsigned ch, unsigned x, unsigned y) oled_blit_strip (vram, x, x + 8, 0xff << shift, shift, font8x8[ch]); - if (shift) - { - x += SSD1306_WIDTH; - shift = 8 - shift; - oled_blit_strip (vram, x, x + 8, 0xff >> shift, -shift, font8x8[ch]); - } + if (shift) { + x += SSD1306_WIDTH; + shift = 8 - shift; + oled_blit_strip (vram, x, x + 8, 0xff >> shift, -shift, font8x8[ch]); + } } void -font8x8_put_str (uint8_t * vram, char *str, unsigned x, unsigned y) +font8x8_put_str (uint8_t *vram, char *str, unsigned x, unsigned y) { - while (*str) - { - font8x8_put_ch (vram, *(str++), x, y); - x += 8; - } + while (*str) { + font8x8_put_ch (vram, * (str++), x, y); + x += 8; + } } -- cgit v1.2.3