From 93dfd87a7a38e5856d0d1038510f6ec1602881ae Mon Sep 17 00:00:00 2001 From: _VIFEXTech <1290176185@qq.com> Date: Sun, 8 May 2022 04:58:38 +0800 Subject: [PATCH] feat(anim): add the function of getting global animation refresher timer (#3331) * feat(anim): add dynamic setting animation refresh period support * add lv_anim_get_refr_period * add lv_anim_get_timer Co-authored-by: pengyiqiang --- src/misc/lv_anim.c | 5 +++++ src/misc/lv_anim.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/misc/lv_anim.c b/src/misc/lv_anim.c index ecb95840d..133b59ff3 100644 --- a/src/misc/lv_anim.c +++ b/src/misc/lv_anim.c @@ -177,6 +177,11 @@ lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb) return NULL; } +struct _lv_timer_t * lv_anim_get_timer(void) +{ + return _lv_anim_tmr; +} + uint16_t lv_anim_count_running(void) { uint16_t cnt = 0; diff --git a/src/misc/lv_anim.h b/src/misc/lv_anim.h index 18317eb38..3a8dc30f7 100644 --- a/src/misc/lv_anim.h +++ b/src/misc/lv_anim.h @@ -40,6 +40,7 @@ typedef enum { } lv_anim_enable_t; struct _lv_anim_t; +struct _lv_timer_t; /** Get the current value during an animation*/ typedef int32_t (*lv_anim_path_cb_t)(const struct _lv_anim_t *); @@ -345,6 +346,12 @@ void lv_anim_del_all(void); */ lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb); +/** + * Get global animation refresher timer. + * @return pointer to the animation refresher timer. + */ +struct _lv_timer_t * lv_anim_get_timer(void); + /** * Delete an animation by getting the animated variable from `a`. * Only animations with `exec_cb` will be deleted.