From d23f0d1bd536820fe335a8013211a1c5e1d20bb2 Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Tue, 18 Jan 2022 18:22:21 -0500 Subject: [PATCH] 16to-8bpp --- teensy/RA8875_t4.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teensy/RA8875_t4.h b/teensy/RA8875_t4.h index 8127a2b..f94fd98 100644 --- a/teensy/RA8875_t4.h +++ b/teensy/RA8875_t4.h @@ -38,6 +38,10 @@ class RA8875_t4 { void drawPixel(int16_t x, int16_t y, uint16_t color); uint32_t frameCount(); + uint8_t color16To8bpp(uint16_t color) __attribute__((always_inline)) { + return ((color & 0xe000) >> 8) | ((color & 0x700) >> 6) | ((color & 0x18) >> 3); + } + private: void _initializeTFT();