• Alessandro Rubini's avatar
    servo: discard too-long one-way-delay values · 968f1888
    Alessandro Rubini authored
    This commit almost ignores long owd values. They happen when there are
    software delays; for example I sometimes see 7ms RTT values every now
    and then, which destroy synchronization by a few hundred microseconds.
    
    I "almost" ignore them, by using an OWD value twice as the current
    average.  This is meant to gradually recover if the real OWD is bigger
    than what we initially measured (e.g., initially the slave clock was
    too slow during a recovery).
    
    The commit also slightly reorders some calculation to be safer in
    dealing with errors in initial values.
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    968f1888
servo.c 7.18 KB