feat(refr): add reset function for FPS statistics (#2832)
* fix(Kconfig) remove duplicate LV_BUILD_EXAMPLES configuration * feat(refr) add reset of FPS statistics Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
@@ -321,8 +321,17 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
|
||||
}
|
||||
|
||||
#if LV_USE_PERF_MONITOR
|
||||
void lv_refr_reset_fps_counter(void)
|
||||
{
|
||||
fps_sum_all = 0;
|
||||
fps_sum_cnt = 0;
|
||||
}
|
||||
|
||||
uint32_t lv_refr_get_fps_avg(void)
|
||||
{
|
||||
if(fps_sum_cnt == 0)
|
||||
return 0;
|
||||
|
||||
return fps_sum_all / fps_sum_cnt;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -80,7 +80,12 @@ void _lv_refr_set_disp_refreshing(lv_disp_t * disp);
|
||||
|
||||
#if LV_USE_PERF_MONITOR
|
||||
/**
|
||||
* Get the average FPS since start up
|
||||
* Reset FPS counter
|
||||
*/
|
||||
void lv_refr_reset_fps_counter(void);
|
||||
|
||||
/**
|
||||
* Get the average FPS
|
||||
* @return the average FPS
|
||||
*/
|
||||
uint32_t lv_refr_get_fps_avg(void);
|
||||
|
||||
Reference in New Issue
Block a user