UP
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
*====================*/
|
||||
|
||||
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
|
||||
#define LV_COLOR_DEPTH 16
|
||||
#define LV_COLOR_DEPTH 32
|
||||
|
||||
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
|
||||
#define LV_COLOR_16_SWAP 0
|
||||
@@ -230,7 +230,7 @@
|
||||
*-----------*/
|
||||
|
||||
/*Enable the log module*/
|
||||
#define LV_USE_LOG 1
|
||||
#define LV_USE_LOG 0
|
||||
#if LV_USE_LOG
|
||||
|
||||
/*How important log should be added:
|
||||
|
@@ -44,7 +44,7 @@ static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static SIM_Display_t lvgl_display;
|
||||
SIM_Display_t lvgl_display;
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
@@ -142,7 +142,7 @@ void lv_port_disp_init(void)
|
||||
static void disp_init(void)
|
||||
{
|
||||
/*You code here*/
|
||||
SIM_Display_Init("LVGL", MY_DISP_HOR_RES, MY_DISP_VER_RES, 0xffffff, BLACK, 1, &lvgl_display);
|
||||
SIM_Display_Init("LVGL", MY_DISP_HOR_RES, MY_DISP_VER_RES, 0xffffff, BLACK, 2, &lvgl_display);
|
||||
}
|
||||
|
||||
volatile bool disp_flush_enabled = true;
|
||||
@@ -165,7 +165,7 @@ void colortorgb24(lv_color_t* color_p, uint32_t* color, size_t len)
|
||||
{
|
||||
while (len)
|
||||
{
|
||||
*color = RGB565_to_RGB888(color_p->full, false);
|
||||
*color = RGB565_to_ARGB8888(color_p->full, false);
|
||||
color_p++;
|
||||
color++;
|
||||
len--;
|
||||
@@ -180,13 +180,13 @@ static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_
|
||||
if (disp_flush_enabled)
|
||||
{
|
||||
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
|
||||
uint32_t* color;
|
||||
size_t l = (area->x2 - area->x1) * (area->y2 - area->y1);
|
||||
color = (uint32_t*)malloc(sizeof(uint32_t) * l);
|
||||
|
||||
colortorgb24(color_p, color, l);
|
||||
SIM_Color_FillFromBuffer(&lvgl_display, color, area->x1, area->y1, area->x2, area->y2);
|
||||
free(color);
|
||||
// uint32_t* color;
|
||||
size_t l = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1);
|
||||
// color = (uint32_t*)malloc(sizeof(uint32_t) * l);
|
||||
//
|
||||
// colortorgb24(color_p, color, l);
|
||||
SIM_Color_FillFromBuffer(&lvgl_display, (uint32_t *) color_p, area->x1, area->y1, area->x2, area->y2);
|
||||
// free(color);
|
||||
}
|
||||
|
||||
/*IMPORTANT!!!
|
||||
|
Reference in New Issue
Block a user