How to solve the split screen problem?

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

I am using lvgl to create UI interface, but I have encountered strange problems. Since I just came into contact with lvgl8.2, I only wanted to display one icon on the interface at first, but I found that the screen interface was divided into two parts. I only created one icon, but two icons were displayed, and it can be seen that the width of the icon has become half. How to solve this problem?

What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?

lvgl8.2

What do you want to achieve?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

static lv_color_t* disp_buf1;
void display_init()
{
fbdev_init();
disp_buf1 = (lv_color_t*)malloc(HOR_RES VER_RESsizeof(lv_color_t));
static lv_disp_draw_buf_t draw_buf;
lv_disp_draw_buf_init(&draw_buf, disp_buf1, NULL, HOR_RES * VER_RES);
static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.draw_buf = &draw_buf;
disp_drv.flush_cb = fbdev_flush;
disp_drv.hor_res = HOR_RES;
disp_drv.ver_res = VER_RES;
lv_disp_drv_register(&disp_drv);
}

void create_ui()
{
lv_obj_t* label = lv_label_create(lv_scr_act());
lv_label_set_text(label, LV_SYMBOL_OK);
lv_obj_set_style_text_font(label, &lv_font_montserrat_32, 0);
}

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Sloved.
The device screen is 32bpp,but i set LV_COLOR_DEPTH 16 in lv_conf.h.

1 Like