Commit 12500686 authored by baujc's avatar baujc

Force to UNCALIBRATED state

Force to stay in UNCALIBRATED state if externalPortConfigurationEnabled
is set to true and desiredState to UNCALIBRATED.
parent 36c0c7ee
......@@ -242,7 +242,7 @@ static int slave_handle_announce(struct pp_instance *ppi, void *buf, int len)
int pp_slave(struct pp_instance *ppi, void *buf, int len)
{
int ret = PP_SEND_OK; /* error var, to check errors in msg handling */
int uncalibrated = (ppi->state == PPS_UNCALIBRATED);
Boolean uncalibrated = (ppi->state == PPS_UNCALIBRATED);
MsgHeader *hdr = &ppi->received_ptp_header;
/* upgrade from uncalibrated to slave or back*/
......@@ -257,8 +257,10 @@ int pp_slave(struct pp_instance *ppi, void *buf, int len)
}
/* Force to stay on desired state if externalPortConfiguration option is enabled */
if (is_externalPortConfigurationEnabled(DSDEF(ppi)) )
ppi->next_state = ppi->externalPortConfigurationPortDS.desiredState;
if (is_externalPortConfigurationEnabled(DSDEF(ppi)) &&
ppi->next_state == PPS_SLAVE &&
ppi->externalPortConfigurationPortDS.desiredState==PPS_UNCALIBRATED)
ppi->next_state = PPS_UNCALIBRATED; //Force to stay in uncalibrated state
/* when entering uncalibrated init servo */
if (uncalibrated && (ppi->is_new_state)) {
......
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