/* Execute timer if its remaining time is zero  */
static bool lv_timer_exec(lv_timer_t *timer)
/* Execute timer if its remaining time is zero  */
static bool lv_timer_exec(lv_timer_t *timer)
{
    if(timer->paused) return false;
    bool exec = false;
    if(lv_timer_time_remaining(timer) == 0) {
        int32_t original_repeat_count = timer->repeat_count;
        if(timer->repeat_count > 0) timer->repeat_count--;
        timer->last_run = lv_tick_get();
        TIMER_TRACE("calling timer callback: %p", *((void **)&timer->timer_cb));
        if(timer->timer_cb && original_repeat_count != 0) timer->timer_cb(timer);
        TIMER_TRACE("timer callback %p finished", *((void **)&timer->timer_cb));
        LV_ASSERT_MEM_INTEGRITY();
        exec = true;
    }
    if(timer_deleted == false) {
        if(timer->repeat_count == 0) {
            TIMER_TRACE("deleting timer with %p callback because the repeat count is over", *((void **)&timer->timer_cb));
            lv_timer_del(timer);
        }
    }
    return exec;
}