Hi All
lv_disp_drv_t.flush_cb() just calls when display has an update.
But how to flush_cb does periodically even without having display update ?
For example, each 100ms, flush_cb will be called.
Thanks!
Hi All
lv_disp_drv_t.flush_cb() just calls when display has an update.
But how to flush_cb does periodically even without having display update ?
For example, each 100ms, flush_cb will be called.
Thanks!
static void call_refresh_cb(lv_timer_t *timer)
{
lv_obj_invalidate(lv_scr_act());
lv_refr_now(NULL);
}
lv_timer_create(call_refresh_cb, 100, NULL);
Hi @spider_vc
Is there any conflict when doing âcall_refresh_cb by timerâ and ânew display update callâ.
or do first done first, come later must wait ?
Hi @kisvegabor , @embeddedt
Maybe @spider_vc is busy now, could you answer this question?
â How to set flush_cb to control its execution.
In my app, I want to execute flush_cb each 30ms.
during this time, no matter how much the updated object is, the flush_cb will not be executed.
Right at the time of 30ms, all of them will be included in one flush_cb.
Thanks for your support!
I think you need this feature:
https://docs.lvgl.io/master/porting/display.html#decoupling-the-display-refresh-timer
Hi @kisvegabor
Thanks your reply soon.
As description in your link, xxx_timer is using.
It is xxx_task in LVGL version 7.10.1, isnât it?
This feature is new working only from v8
Is it possible for you to update to v8?
Hi @kisvegabor
Is there any other solution in v7?
Iâm using Gui Guider, and itâs not support v8.
Its latest version already supports v8.
Hi @kisvegabor
ïŒIts latest version already supports v8.
Thanks for your information. I will check that.
By the way, I edited something as below code, could you help me see if there is any risk?
lv_refr.c
in _lv_inv_area(), I comment out refr task priority setting to prevent refresh screen when update any object.
void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
{
ă»ă»ă»
disp->inv_p++;
//â
lv_task_set_prio(disp->refr_task, LV_REFR_TASK_PRIO);
}
In my application
static void gui_update(lv_task_t * task)
{
s_disp_lcd = lv_disp_get_default();
lv_task_set_prio(s_disp_lcd->refr_task, LV_REFR_TASK_PRIO);
}
It will still update the screen in lv_task_handler
.
You should call s_disp_lcd->refr_task()
directly but you also need to add minor tweaks in refr_task
because it waits for an lv_task_t *
as itâs parameter.
Thanks for your support!