mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(display): fix incorrect assert conditions (#5400)
This commit is contained in:
parent
f470539f4c
commit
a8f1d82b66
@ -413,15 +413,13 @@ void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint3
|
||||
if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) {
|
||||
/* for partial mode, we calculate the height based on the buf_size and stride */
|
||||
h = buf_size / stride;
|
||||
LV_ASSERT_MSG(h != 0, "the buffer is too small");
|
||||
}
|
||||
else {
|
||||
LV_ASSERT_MSG(stride * h < buf_size, "%s mode requires screen sized buffer(s)",
|
||||
LV_ASSERT_MSG(stride * h <= buf_size, "%s mode requires screen sized buffer(s)",
|
||||
render_mode == LV_DISPLAY_RENDER_MODE_FULL ? "FULL" : "DIRECT");
|
||||
return;
|
||||
}
|
||||
|
||||
LV_ASSERT_MSG(h != 0, "the buffer is too small");
|
||||
|
||||
lv_draw_buf_init(&disp->_static_buf1, w, h, cf, stride, buf1, buf_size);
|
||||
lv_draw_buf_init(&disp->_static_buf2, w, h, cf, stride, buf2, buf_size);
|
||||
lv_display_set_draw_buffers(disp, &disp->_static_buf1, buf2 ? &disp->_static_buf2 : NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user