fix: make it work without the benchmark too

This commit is contained in:
Gabor Kiss-Vamosi
2024-01-25 10:16:23 +01:00
parent 69aed6ce7c
commit 3e53ed7335

View File

@@ -463,12 +463,14 @@ static void next_scene_timer_cb(lv_timer_t * timer)
#if LV_USE_PERF_MONITOR #if LV_USE_PERF_MONITOR
void sysmon_perf_observer_cb(uint32_t fps, uint32_t cpu, uint32_t render_time, uint32_t flush_time) void sysmon_perf_observer_cb(uint32_t fps, uint32_t cpu, uint32_t render_time, uint32_t flush_time)
{ {
lv_label_set_text_fmt(sysmon_label , if(sysmon_label) {
"%s: " lv_label_set_text_fmt(sysmon_label ,
"%" LV_PRIu32" FPS, %" LV_PRIu32 "%% CPU\n" "%s: "
"%"LV_PRIu32" ms = %"LV_PRIu32" ms + %"LV_PRIu32" ms", "%" LV_PRIu32" FPS, %" LV_PRIu32 "%% CPU\n"
scenes[scene_act].name, "%"LV_PRIu32" ms = %"LV_PRIu32" ms + %"LV_PRIu32" ms",
fps, cpu, render_time + flush_time, render_time, flush_time); scenes[scene_act].name,
fps, cpu, render_time + flush_time, render_time, flush_time);
}
/*Ignore the first call as it contains data from the previous scene*/ /*Ignore the first call as it contains data from the previous scene*/
if(scenes[scene_act].measurement_cnt != 0) { if(scenes[scene_act].measurement_cnt != 0) {