• Alessandro Rubini's avatar
    standard servo: bugfix (introduced with pp_time) · cfed2306
    Alessandro Rubini authored
    If meanPathDelay is calculated negative at the first iteration, we
    must zero it immediately, or this will loop forever:
    	while (mpd_fltr->y >> (63 - s))
    The bug only appears with e2e mechanism, where t3 happens long after
    t2, if the slave clock when ppsi starts is running much slower than
    the master.
    Before changing data structures we used abs() in that loop (which was
    suboptimal), and I made a mistake in converting it in a check before
    the loop itlsef.
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
servo.c 10.3 KB