servo: discard too-long one-way-delay values
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 <rubini@gnudd.com>
Showing
Please
register
or
sign in
to comment