diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index d8d4ce6c0..6a3affcda 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -73,6 +73,8 @@ void lv_refr_init(void) */ void lv_refr_now(lv_disp_t * disp) { + lv_anim_refr_now(); + if(disp) { lv_disp_refr_task(disp->refr_task); } else { diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index 073ba7831..197959262 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -172,6 +172,17 @@ uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_va return time; } +/** + * Manually refresh the state of the animations. + * Useful to make the animations running in a blocking process where + * `lv_task_handler` can't run for a while. + * Shouldn't be used directly because it is called in `lv_refr_now()`. + */ +void lv_anim_refr_now(void) +{ + anim_task(NULL); +} + /** * Calculate the current value of an animation applying linear characteristic * @param a pointer to an animation diff --git a/src/lv_misc/lv_anim.h b/src/lv_misc/lv_anim.h index 36cc35adc..95fd6acea 100644 --- a/src/lv_misc/lv_anim.h +++ b/src/lv_misc/lv_anim.h @@ -268,6 +268,14 @@ uint16_t lv_anim_count_running(void); */ uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end); +/** + * Manually refresh the state of the animations. + * Useful to make the animations running in a blocking process where + * `lv_task_handler` can't run for a while. + * Shouldn't be used directly because it is called in `lv_refr_now()`. + */ +void lv_anim_refr_now(void); + /** * Calculate the current value of an animation applying linear characteristic * @param a pointer to an animation