Fixed bug that caused the last slave not to be scanned.
authorFlorian Pose <fp@igh-essen.com>
Tue, 06 Feb 2007 15:13:51 +0000
changeset 538 84beb49d1b11
parent 537 c715766e0f81
child 539 7bb92fca28ef
Fixed bug that caused the last slave not to be scanned.
master/fsm_master.c
--- a/master/fsm_master.c	Mon Jan 15 09:49:07 2007 +0000
+++ b/master/fsm_master.c	Tue Feb 06 15:13:51 2007 +0000
@@ -697,15 +697,15 @@
 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;
     }