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 <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2022-05-08 04:58:38 +08:00
committed by GitHub
parent 45a39a11fe
commit 93dfd87a7a
2 changed files with 12 additions and 0 deletions

View File

@@ -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;

View File

@@ -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.