summaryrefslogtreecommitdiffstats
path: root/drivers/painter/tft_panel/qp_tft_panel.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
committerNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
commit4020674163fc80914059c4c9c3be5c0ae00bd150 (patch)
tree6f4187d72b04d03572adf507502afbda9726d696 /drivers/painter/tft_panel/qp_tft_panel.c
parent8f9b49dc5b05fd3421e47aa76822a5b2199dfca6 (diff)
parent9e78e65a566487b2f4fe7b663971a01deb6ddad2 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'drivers/painter/tft_panel/qp_tft_panel.c')
-rw-r--r--drivers/painter/tft_panel/qp_tft_panel.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/painter/tft_panel/qp_tft_panel.c b/drivers/painter/tft_panel/qp_tft_panel.c
index ad83b6c792..e7c744ab34 100644
--- a/drivers/painter/tft_panel/qp_tft_panel.c
+++ b/drivers/painter/tft_panel/qp_tft_panel.c
@@ -7,8 +7,6 @@
#include "qp_draw.h"
#include "qp_tft_panel.h"
-#define BYTE_SWAP(x) (((((uint16_t)(x)) >> 8) & 0x00FF) | ((((uint16_t)(x)) << 8) & 0xFF00))
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Quantum Painter API implementations
@@ -94,7 +92,7 @@ bool qp_tft_panel_palette_convert_rgb565_swapped(painter_device_t device, int16_
for (int16_t i = 0; i < palette_size; ++i) {
RGB rgb = hsv_to_rgb_nocie((HSV){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v});
uint16_t rgb565 = (((uint16_t)rgb.r) >> 3) << 11 | (((uint16_t)rgb.g) >> 2) << 5 | (((uint16_t)rgb.b) >> 3);
- palette[i].rgb565 = BYTE_SWAP(rgb565);
+ palette[i].rgb565 = __builtin_bswap16(rgb565);
}
return true;
}