Commit 2e89059b authored by Tristan Gingold's avatar Tristan Gingold

l1e: re-init servo when entering config_match

Avoid uninitialized wrh servo
parent d28c0afb
......@@ -184,12 +184,10 @@ int wrh_servo_got_presp(struct pp_instance *ppi)
static void setState(struct pp_instance *ppi, int newState)
{
struct pp_servo *gs=SRV(ppi);
if ( gs->state != newState ) {
const char *state_name = wrh_servo_state_name[newState];
pp_diag(ppi, servo, 2, "new state %s\n", state_name);
gs->state=newState;
gs->servo_state_name = state_name;
}
const char *state_name = wrh_servo_state_name[newState];
pp_diag(ppi, servo, 2, "new state %s\n", state_name);
gs->state=newState;
gs->servo_state_name = state_name;
}
static int __wrh_servo_update(struct pp_instance *ppi)
......
......@@ -335,6 +335,7 @@ static int l1e_handle_state_config_match(struct pp_instance *ppi, Boolean new_st
basic->isRxCoherent=0;
pp_diag(ppi, ext, 1, "Locking PLL\n");
WRH_OPER()->locking_enable(ppi);
l1e_servo_init(ppi);
}
break;
case PPS_MASTER :
......@@ -414,7 +415,8 @@ static int l1e_handle_state_up(struct pp_instance *ppi, Boolean new_state)
}
/* Iterative treatment */
pdstate_enable_extension(ppi);
if (new_state)
pdstate_enable_extension(ppi);
l1e_send_sync_msg(ppi,0);
return pp_next_delay_2(ppi,PP_TO_L1E_TX_SYNC, PP_TO_L1E_RX_SYNC); /* Return the shorter timeout */
}
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