smooth: don't adjust invalid time of last update
This commit is contained in:
parent
f91bdd604d
commit
ed5c43204b
1 changed files with 4 additions and 1 deletions
3
smooth.c
3
smooth.c
|
@ -246,6 +246,7 @@ handle_slew(struct timespec *raw, struct timespec *cooked, double dfreq,
|
||||||
update_smoothing(cooked, doffset, dfreq);
|
update_smoothing(cooked, doffset, dfreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!UTI_IsZeroTimespec(&last_update))
|
||||||
UTI_AdjustTimespec(&last_update, cooked, &last_update, &delta, dfreq, doffset);
|
UTI_AdjustTimespec(&last_update, cooked, &last_update, &delta, dfreq, doffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +265,8 @@ void SMT_Initialise(void)
|
||||||
max_freq *= 1e-6;
|
max_freq *= 1e-6;
|
||||||
max_wander *= 1e-6;
|
max_wander *= 1e-6;
|
||||||
|
|
||||||
|
UTI_ZeroTimespec(&last_update);
|
||||||
|
|
||||||
LCL_AddParameterChangeHandler(handle_slew, NULL);
|
LCL_AddParameterChangeHandler(handle_slew, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue