add lv_anim_refr_now()

This commit is contained in:
Gabor Kiss-Vamosi
2019-12-19 11:14:51 +01:00
parent 23a040670e
commit 8e5446c68f
3 changed files with 21 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ void lv_refr_init(void)
*/ */
void lv_refr_now(lv_disp_t * disp) void lv_refr_now(lv_disp_t * disp)
{ {
lv_anim_refr_now();
if(disp) { if(disp) {
lv_disp_refr_task(disp->refr_task); lv_disp_refr_task(disp->refr_task);
} else { } else {

View File

@@ -172,6 +172,17 @@ uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_va
return time; 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 * Calculate the current value of an animation applying linear characteristic
* @param a pointer to an animation * @param a pointer to an animation

View File

@@ -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); 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 * Calculate the current value of an animation applying linear characteristic
* @param a pointer to an animation * @param a pointer to an animation