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 <[email protected]> --- pi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pi.c b/pi.c index 171ff55..52d4c2f 100644 --- a/pi.c +++ b/pi.c @@ -116,8 +116,8 @@ static double pi_sample(struct servo *servo, else if (s->drift > s->maxppb) s->drift = s->maxppb; - if (!s->first_update || - (s->max_f_offset && (s->max_f_offset < fabs(offset))) || + if ((s->first_update && + s->max_f_offset && (s->max_f_offset < fabs(offset))) || (s->max_offset && (s->max_offset < fabs(offset)))) *state = SERVO_JUMP; else -- 1.8.4.2 ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Linuxptp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
