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
What MCU/Processor/Board and compiler are you using?
STM32L476RG
What LVGL version are you using?
v8.3
What do you want to achieve?
I want to print it out on the entire LCD screen, but the garbage value is printed on top.
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*/
This is my lvgl init code.
void Display_init(void)
{
lv_init();
static lv_disp_draw_buf_t disp_buf;
static lv_color_t buf_1[DISP_BUF_SIZE];
lv_disp_draw_buf_init(&disp_buf, buf_1, NULL, DISP_BUF_SIZE);
// Driver
lv_disp_drv_init(&disp_drv);
disp_drv.draw_buf = &disp_buf;
disp_drv.flush_cb = my_flush_cb;
disp_drv.hor_res = SSD1327_LCDWIDTH;
disp_drv.ver_res = SSD1327_LCDHEIGHT;
disp_drv.sw_rotate = 1;
lv_theme_mono_init(0, false, NULL);
lv_theme_mono_is_inited();
disp = lv_disp_drv_register(&disp_drv);
lv_disp_set_rotation(disp, LV_DISP_ROT_NONE);
LV_IMG_DECLARE(test_image2);
// LV_IMG_DECLARE(img_lvgl_logo);
img1 = lv_img_create(lv_scr_act());
lv_img_set_src(img1, &test_image2);
lv_obj_align(img1, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_size(img1, 128, 128);
lv_obj_t * img2 = lv_img_create(lv_scr_act());
lv_img_set_src(img2, LV_SYMBOL_OK "Accept");
lv_obj_align_to(img2, img1, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
}
And This is my flush callback function.
static void my_flush_cb(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
{
if(area->x2 < 0 || area->y2 < 0)
return;
if(area->x1 > SSD1327_LCDWIDTH -1) return;
if(area->y1 > SSD1327_LCDHEIGHT -1) return;
int16_t x, y;
uint8_t *buf = (uint8_t*) color_p;
for(y = area->y1; y <= area->y2; y++) {
lcd_setwindow();
for(x = area->x1; x <= area->x2; x++) {
SSD1327_DrawPixel(x, y, (uint8_t)color_p->full);
color_p++;
}
}
lv_disp_flush_ready(disp_drv);
}
And I don’t know how to display whole screen.
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.