lvgl/src/lv_misc/lv_anim.c
/**
 * Create an animation
 * @param a an initialized 'anim_t' variable. Not required after call.
 */
Create an animation
@param a an initialized 'anim_t' variable. Not required after call.
Create an animation @param a an initialized ' anim_t ' variable . Not required after call .
void lv_anim_create(lv_anim_t * a)
{
    LV_LOG_TRACE("animation create started")
    if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); 
    lv_anim_t * new_anim = lv_ll_ins_head(&LV_GC_ROOT(_lv_anim_ll));
    LV_ASSERT_MEM(new_anim);
    if(new_anim == NULL) return;
    a->playback_now = 0;
    memcpy(new_anim, a, sizeof(lv_anim_t));
    if(new_anim->exec_cb) new_anim->exec_cb(new_anim->var, new_anim->start);
    anim_list_changed = true;
    LV_LOG_TRACE("animation created")
}
void lv_anim_create ( lv_anim_t * a ) { LV_LOG_TRACE ( " " ) if ( a -> exec_cb != NULL ) lv_anim_del ( a -> var , a -> exec_cb ) ; lv_anim_t * new_anim = lv_ll_ins_head ( & LV_GC_ROOT ( _lv_anim_ll ) ) ; LV_ASSERT_MEM ( new_anim ) ; if ( new_anim == NULL ) return ; a -> playback_now = 0 ; memcpy ( new_anim , a , sizeof ( lv_anim_t ) ) ; if ( new_anim -> exec_cb ) new_anim -> exec_cb ( new_anim -> var , new_anim -> start ) ; anim_list_changed = true ; LV_LOG_TRACE ( " " ) }
Create an animation
 @param a an initialized 'anim_t' variable.
Create an animation @param a an initialized ' anim_t ' variable .
/* Do not let two animations for the  same 'var' with the same 'fp'*/ /*fp == NULL would delete all animations of var*/ /*Add the new animation to the animation linked list*/ /*Initialize the animation descriptor*/ /*Set the start value*/ /* Creating an animation changed the linked list.
     * It's important if it happens in a ready callback. (see `anim_task`)*/