Commit e7ecdb91 authored by Tristan Gingold's avatar Tristan Gingold

Minor rewrite

parent 4a20c78e
......@@ -326,9 +326,10 @@ int pp_state_machine(struct pp_instance *ppi, void *buf, int len)
return pp_leave_current_state(ppi);
/* Check protocol state */
if ( ppi->extState==PP_EXSTATE_ACTIVE &&
(ppi->pdstate==PP_PDSTATE_PDETECTION || ppi->pdstate==PP_PDSTATE_PDETECTED) &&
pp_timeout(ppi, PP_TO_PROT_STATE) ) {
if ( ppi->extState==PP_EXSTATE_ACTIVE
&& (ppi->pdstate==PP_PDSTATE_PDETECTION
|| ppi->pdstate==PP_PDSTATE_PDETECTED)
&& pp_timeout(ppi, PP_TO_PROT_STATE) ) {
pdstate_disable_extension(ppi);
}
......
......@@ -82,7 +82,7 @@ int wrh_servo_init(struct pp_instance *ppi)
WRH_SERVO_RESET_DATA(s);
/* Update correction data in data sets*/
if (wrh_update_correction_values(ppi) != -1) {
if (wrh_update_correction_values(ppi) == 0) {
/*
* Do not reset cur_setpoint, but trim it to be less than one tick.
......
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