Fixed reset of allow_scanning flag if ecrt_master_activate() was not called.
This commit is contained in:
parent
8f5d8b736c
commit
6ee0a18ac7
|
|
@ -594,7 +594,7 @@ int ec_master_enter_operation_phase(
|
|||
if (ret) {
|
||||
EC_MASTER_INFO(master, "Finishing slave configuration"
|
||||
" interrupted by signal.\n");
|
||||
goto out_allow;
|
||||
goto out_return;
|
||||
}
|
||||
|
||||
EC_MASTER_DBG(master, 1, "Waiting for pending slave"
|
||||
|
|
@ -645,6 +645,7 @@ int ec_master_enter_operation_phase(
|
|||
|
||||
out_allow:
|
||||
master->allow_scan = 1;
|
||||
out_return:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -662,6 +663,9 @@ void ec_master_leave_operation_phase(
|
|||
ec_master_clear_config(master);
|
||||
}
|
||||
|
||||
/* Re-allow scanning for IDLE phase. */
|
||||
master->allow_scan = 1;
|
||||
|
||||
EC_MASTER_DBG(master, 1, "OPERATION -> IDLE.\n");
|
||||
|
||||
master->phase = EC_IDLE;
|
||||
|
|
@ -2038,7 +2042,9 @@ int ecrt_master_activate(ec_master_t *master)
|
|||
return ret;
|
||||
}
|
||||
|
||||
master->allow_scan = 1; // allow re-scanning on topology change
|
||||
/* Allow scanning after a topology change. */
|
||||
master->allow_scan = 1;
|
||||
|
||||
master->active = 1;
|
||||
|
||||
// notify state machine, that the configuration shall now be applied
|
||||
|
|
@ -2109,7 +2115,10 @@ void ecrt_master_deactivate(ec_master_t *master)
|
|||
"EtherCAT-IDLE"))
|
||||
EC_MASTER_WARN(master, "Failed to restart master thread!\n");
|
||||
|
||||
master->allow_scan = 1;
|
||||
/* Disallow scanning to get into the same state like after a master
|
||||
* request (after ec_master_enter_operation_phase() is called). */
|
||||
master->allow_scan = 0;
|
||||
|
||||
master->active = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue