Commit 39c84eee authored by Adam Wujek's avatar Adam Wujek 💬

proto-ext-whiterabbit: check offset and rtt for negative values

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 74a79aab
......@@ -416,12 +416,12 @@ int wr_servo_update(struct pp_instance *ppi)
/* Increase number of servo updates with offset exceeded
* SNMP_MAX_OFFSET (Used by SNMP) */
if (s->offset > SNMP_MAX_OFFSET)
if (abs(s->offset) > SNMP_MAX_OFFSET)
s->n_err_offset++;
/* Increase number of servo updates with delta rtt exceeded
* SNMP_MAX_DELTA_RTT (Used by SNMP) */
if (picos_mu_prev - s->picos_mu > SNMP_MAX_DELTA_RTT)
if (abs(picos_mu_prev - s->picos_mu) > SNMP_MAX_DELTA_RTT)
s->n_err_delta_rtt++;
/* Increase number of servo updates with delta_*x_* bigger than
......
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