Commit ba5a7a99 authored by Omar Gabella's avatar Omar Gabella

KM3NET BROADCAST : TimestampsIncorrect, set to 1 HAS_FAULTS in broadcast.

			If errcount > 5 set wrModeOn to False.

This modifications are needed because each time we reach an errcount > 5 (t1 timestamp flagged as
incorrect 5 consecutive times), we get stucked on uninitialized servo state.
parent 33556dfb
......@@ -11,6 +11,13 @@
#ifdef CONFIG_WRPC_FAULTS
#define HAS_FAULTS 1
#elif BROADCAST
/* Sometimes we have 5 consecutives times a t1 timestamp flagged as inscorrect.
* At the moment this situation occurs, the software flag all subsequent t1 timestamps
* as incorrect so we lose the track phase servo state and get stuck on uninitialized
* servo state. After a first tests seems that enable HAS_FAULTS to apply_faulty_stamp
* solves the problem. */
#define HAS_FAULTS 1
#else
#define HAS_FAULTS 0
#endif
......@@ -452,14 +459,15 @@ int wr_e2e_offset_downlink(struct pp_instance *ppi,
static int errcount;
if (is_incorrect(&s->t1) || is_incorrect(&s->t2)) {
//KM3 || is_incorrect(&s->t3) || is_incorrect(&s->t4)) {
errcount++;
if (errcount > 5) /* a 2-3 in a row are expected */
//KM3 pp_error("%s: TimestampsIncorrect: %d %d %d %d\n", __func__,
if (errcount > 5) {/* a 2-3 in a row are expected */
pp_error("%s: TimestampsIncorrect: %d %d\n", __func__,
!is_incorrect(&s->t1), !is_incorrect(&s->t2));
//KM3 !is_incorrect(&s->t3), !is_incorrect(&s->t4));
return 0;
/* If errcount > 5 we reset the wrMode so as not get stuck on the
* uninitialized servo state. */
WR_DSPOR(ppi)->wrModeOn = FALSE;
}
return 0;
}
if (wrp->ops->servo_hook) /* FIXME: check this, missing in p2p */
......@@ -475,13 +483,11 @@ int wr_e2e_offset_downlink(struct pp_instance *ppi,
{ /* avoid modifying stamps in place */
struct pp_time mtime, stime;
//KM3 mtime = s->t4;
/* On met les temps t3 et t4 à 0, car on n'est pas sensés les utiliser. */
mtime.secs = 0;
mtime.scaled_nsecs = 0;
pp_time_sub(&mtime, &s->t1);
//KM3 stime = s->t3;
stime.secs = 0;
stime.scaled_nsecs = 0;
pp_time_sub(&stime, &s->t2);
......@@ -493,8 +499,6 @@ int wr_e2e_offset_downlink(struct pp_instance *ppi,
if (__PP_DIAG_ALLOW(ppi, pp_dt_servo, 1)) {
dump_timestamp(ppi, "servo:t1", s->t1);
dump_timestamp(ppi, "servo:t2", s->t2);
//KM3 dump_timestamp(ppi, "servo:t3", s->t3);
//KM3 dump_timestamp(ppi, "servo:t4", s->t4);
dump_timestamp(ppi, "->mdelay", s->mu);
}
......
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