Commit 6f8bd484 authored by Jean-Claude BAU's avatar Jean-Claude BAU Committed by Adam Wujek

Fix externalPortConfiguration issues

- Force to stay on UNCALIBRATED state (was going to slave state)
- Force to stay on PRE-MASTER state  (was going to master state)
parent 2e5d6f4d
......@@ -49,9 +49,11 @@ int pp_master(struct pp_instance *ppi, void *buf, int len)
* master */
/* upgrade from pre-master to master */
if (pre && pp_timeout(ppi, PP_TO_QUALIFICATION)) {
if (pre &&
pp_timeout(ppi, PP_TO_QUALIFICATION) &&
!DSDEF(ppi)->externalPortConfigurationEnabled) {
ppi->next_state = PPS_MASTER;
/* start sending imediately and reenter */
/* start sending immediately and reenter */
pp_timeout_clear(ppi, PP_TO_SYNC_SEND);
pp_timeout_clear(ppi, PP_TO_ANN_SEND);
ppi->next_delay = 0;
......
......@@ -223,10 +223,12 @@ int pp_slave(struct pp_instance *ppi, void *buf, int len)
}
} else {
/* TODO add implementation specific SYNCHRONIZATION event */
if (! DSDEF(ppi)->externalPortConfigurationEnabled )
if (pp_timeout(ppi, PP_TO_FAULT))
ppi->next_state = PPS_UNCALIBRATED;
}
/* Force to stay on desired state if externalPortConfiguration option is enabled */
if (DSDEF(ppi)->externalPortConfigurationEnabled )
ppi->next_state = ppi->externalPortConfigurationPortDS.desiredState;
/* 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