lv_anim: add lv_anim_count_running

This commit is contained in:
Gabor Kiss-Vamosi
2018-11-09 12:36:38 +01:00
parent 63bc66c40d
commit a4d950a2f2
2 changed files with 19 additions and 0 deletions

View File

@@ -115,6 +115,19 @@ bool lv_anim_del(void * var, lv_anim_fp_t fp)
return del;
}
/**
* Get the number of currently running animations
* @return the number of running animations
*/
uint16_t lv_anim_count_running(void)
{
uint16_t cnt = 0;
lv_anim_t * a;
LL_READ(anim_ll, a) cnt++;
return cnt++;
}
/**
* Calculate the time of an animation with a given speed and the start and end values
* @param speed speed of animation in unit/sec

View File

@@ -99,6 +99,12 @@ void lv_anim_create(lv_anim_t * anim_p);
*/
bool lv_anim_del(void * var, lv_anim_fp_t fp);
/**
* Get the number of currently running animations
* @return the number of running animations
*/
uint16_t lv_anim_count_running(void);
/**
* Calculate the time of an animation with a given speed and the start and end values
* @param speed speed of animation in unit/sec