Don't always step clock on PI servo reset.
The initial check if the clock should be stepped always passed after the servo was reset (e.g. from clock sanity check). Fix the condition to step only when the threshold is exceeded. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
91e240679b
commit
72a9212600
4
pi.c
4
pi.c
|
@ -116,8 +116,8 @@ static double pi_sample(struct servo *servo,
|
||||||
else if (s->drift > s->maxppb)
|
else if (s->drift > s->maxppb)
|
||||||
s->drift = s->maxppb;
|
s->drift = s->maxppb;
|
||||||
|
|
||||||
if (!s->first_update ||
|
if ((s->first_update &&
|
||||||
(s->max_f_offset && (s->max_f_offset < fabs(offset))) ||
|
s->max_f_offset && (s->max_f_offset < fabs(offset))) ||
|
||||||
(s->max_offset && (s->max_offset < fabs(offset))))
|
(s->max_offset && (s->max_offset < fabs(offset))))
|
||||||
*state = SERVO_JUMP;
|
*state = SERVO_JUMP;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue