Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Arduino H7 Video - LVGL9.X Double buffer is allocated but never used #1043

Closed
Assignees
leonardocavagnis
Labels
@thodorii

Description

@thodorii

Hi, I've been running into what seems to be memory issues causing an MBED OS crash with LVGL. I was looking around to see draw buffer allocations and ran into this code. I am confused on the purpose of the 2nd draw buffer malloc when it is never used, is this an oversight?

Additionally, should this malloc size be multiplied by sizeof(lv_color_t) for the ideal lvgl recommendation of 1/10th buffer size

@facchinm
 

#if (LVGL_VERSION_MAJOR == 9)
/* Create a draw buffer*/
staticlv_color_t * buf1 = (lv_color_t*)malloc((width() *height() /10));/* Declare a buffer for 1/10 screen size*/
if (buf1 ==NULL) {
return2;/* Insuff memory err*/
}
staticlv_color_t * buf2 = (lv_color_t*)malloc((width() *height() /10));/* Declare a buffer for 1/10 screen size*/
if (buf2 ==NULL) {
return2;/* Insuff memory err*/
}
lv_display_t *display;
if(_rotated) {
display =lv_display_create(height(),width());
lv_display_set_rotation(display, LV_DISPLAY_ROTATION_270);
//display->sw_rotate = 1;
}else {
display =lv_display_create(width(),height());
}
lv_display_set_buffers(display, buf1,NULL,width() *height() /10, LV_DISPLAY_RENDER_MODE_PARTIAL);/*Initialize the display buffer.*/
lv_display_set_flush_cb(display, lvgl_displayFlushing);
lvgl_inc_thd.start(inc_thd);

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp