Merge pull request #11981 from gemu2015/fixlvgl

fix berry compile
This commit is contained in:
Theo Arends 2021-05-01 16:49:56 +02:00 committed by GitHub
commit 0f1193a991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <renderer.h>
#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;