mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-28 13:36:27 +08:00
fixes for performance monitor
This commit is contained in:
@@ -256,8 +256,10 @@ void lv_disp_refr_task(lv_task_t * task)
|
|||||||
|
|
||||||
static uint32_t perf_last_time = 0;
|
static uint32_t perf_last_time = 0;
|
||||||
static uint32_t elaps_max = 1;
|
static uint32_t elaps_max = 1;
|
||||||
if(lv_tick_elaps(perf_last_time) > 300) {
|
if(lv_tick_elaps(perf_last_time) < 300) {
|
||||||
elaps_max = LV_MATH_MAX(elaps, elaps_max);
|
elaps_max = LV_MATH_MAX(elaps, elaps_max);
|
||||||
|
/*Just refresh the label to always have something to monitor*/
|
||||||
|
lv_label_set_text(perf_label, NULL);
|
||||||
} else {
|
} else {
|
||||||
perf_last_time = lv_tick_get();
|
perf_last_time = lv_tick_get();
|
||||||
uint32_t fps = 1000 / (elaps_max == 0 ? 1 : elaps_max);
|
uint32_t fps = 1000 / (elaps_max == 0 ? 1 : elaps_max);
|
||||||
|
|||||||
Reference in New Issue
Block a user