mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-09-21 09:33:47 +08:00
Fixed bug that caused the last slave not to be scanned.
This commit is contained in:
+3
-3
@@ -697,15 +697,15 @@ void ec_fsm_master_state_rewrite_addresses(ec_fsm_master_t *fsm
|
||||
void ec_fsm_master_state_scan_slaves(ec_fsm_master_t *fsm /**< master state machine */)
|
||||
{
|
||||
ec_master_t *master = fsm->master;
|
||||
ec_slave_t *slave = fsm->slave;
|
||||
ec_slave_t *slave;
|
||||
|
||||
if (ec_fsm_slave_exec(&fsm->fsm_slave)) // execute slave state machine
|
||||
return;
|
||||
|
||||
// another slave to fetch?
|
||||
if (slave->list.next != &master->slaves) {
|
||||
if (fsm->slave->list.next != &master->slaves) {
|
||||
fsm->slave = list_entry(fsm->slave->list.next, ec_slave_t, list);
|
||||
ec_fsm_slave_start_scan(&fsm->fsm_slave, slave);
|
||||
ec_fsm_slave_start_scan(&fsm->fsm_slave, fsm->slave);
|
||||
ec_fsm_slave_exec(&fsm->fsm_slave); // execute immediately
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user