Commit a54e9679 authored by Alessandro Rubini's avatar Alessandro Rubini

wr-servo: be silent on expected incorrect stamps

When adjusting the time, we expect stamps to be invalid for a while.
Don't print errors unless the fact repeats unexpectedly.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent c1e3299a
...@@ -256,6 +256,7 @@ int wr_servo_update(struct pp_instance *ppi) ...@@ -256,6 +256,7 @@ int wr_servo_update(struct pp_instance *ppi)
uint64_t tics; uint64_t tics;
uint64_t big_delta_fix; uint64_t big_delta_fix;
uint64_t delay_ms_fix; uint64_t delay_ms_fix;
static int errcount;
TimeInternal ts_offset, ts_offset_hw /*, ts_phase_adjust */; TimeInternal ts_offset, ts_offset_hw /*, ts_phase_adjust */;
...@@ -264,11 +265,14 @@ int wr_servo_update(struct pp_instance *ppi) ...@@ -264,11 +265,14 @@ int wr_servo_update(struct pp_instance *ppi)
if(!s->t1.correct || !s->t2.correct || if(!s->t1.correct || !s->t2.correct ||
!s->t3.correct || !s->t4.correct) { !s->t3.correct || !s->t4.correct) {
pp_error("%s: TimestampsIncorrect: %d %d %d %d\n", __func__, errcount++;
s->t1.correct, s->t2.correct, if (errcount > 5) /* a 2-3 in a row are expected */
s->t3.correct, s->t4.correct); pp_error("%s: TimestampsIncorrect: %d %d %d %d\n",
__func__, s->t1.correct, s->t2.correct,
s->t3.correct, s->t4.correct);
return 0; return 0;
} }
errcount = 0;
cur_servo_state.update_count++; cur_servo_state.update_count++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment