diff options
author | fishsoupisgood <github@madingley.org> | 2020-06-15 14:02:42 +0100 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2020-06-15 14:02:42 +0100 |
commit | 4ced1453cee7a3131459040efd57f73bfc77aece (patch) | |
tree | 78cbcbdcef4847b5b194cf65470ffb45a3e7a8e3 /app/font8x8.c | |
parent | d23934fedc0b76863fcb2ba653560e108309bce6 (diff) | |
download | robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.tar.gz robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.tar.bz2 robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.zip |
guage code
Diffstat (limited to 'app/font8x8.c')
-rw-r--r-- | app/font8x8.c | 24 |
1 files changed, 11 insertions, 13 deletions
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; + } } |