From dbb43e77771a6b132781757f5bc507aa0b85110c Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 1 May 2021 16:24:24 +0200 Subject: [PATCH] fix berry compile --- tasmota/xdrv_54_lvgl.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasmota/xdrv_54_lvgl.ino b/tasmota/xdrv_54_lvgl.ino index af4d6773d..5a3c1df7c 100644 --- a/tasmota/xdrv_54_lvgl.ino +++ b/tasmota/xdrv_54_lvgl.ino @@ -22,6 +22,7 @@ #include #include "lvgl.h" +#include "tasmota_lvgl_assets.h" // force compilation of assets #define XDRV_54 54 @@ -139,6 +140,10 @@ void lv_flush_callback(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *c // save pixels to file int32_t btw = (width * height * LV_COLOR_DEPTH + 7) / 8; while (btw > 0) { +#if (LV_COLOR_DEPTH == 16) && (LV_COLOR_16_SWAP == 1) + uint16_t * pix = (uint16_t*) color_p; + for (uint32_t i = 0; i < btw / 2; i++) (pix[i] = pix[i] << 8 | pix[i] >> 8); +#endif int32_t ret = glue->getScreenshotFile()->write((const uint8_t*) color_p, btw); if (ret >= 0) { btw -= ret;