Commit 6a78aa1b authored by Alessandro Rubini's avatar Alessandro Rubini

Revert "wr-servo: trivial: move a line so it's clearer"

This reverts commit 1d5a461d.

actually, the error count must be zeroed every time, not only after
printing: we want to print if the error persists for 5 iterations, not
every 5th time.

My bad....
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d996debf
......@@ -242,12 +242,10 @@ int wr_servo_update(struct pp_instance *ppi)
if(!s->t1.correct || !s->t2.correct ||
!s->t3.correct || !s->t4.correct) {
errcount++;
if (errcount > 5) { /* a 2-3 in a row are expected */
if (errcount > 5) /* a 2-3 in a row are expected */
pp_error("%s: TimestampsIncorrect: %d %d %d %d\n",
__func__, s->t1.correct, s->t2.correct,
s->t3.correct, s->t4.correct);
errcount = 0;
}
return 0;
}
......@@ -257,6 +255,8 @@ int wr_servo_update(struct pp_instance *ppi)
/* shmem lock */
wrs_shm_write(ppsi_head, WRS_SHM_WRITE_BEGIN);
errcount = 0;
s->update_count++;
got_sync = 0;
......
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