Improved resetting number of responding slaves.
authorFlorian Pose <fp@igh-essen.com>
Fri, 09 Dec 2011 10:35:23 +0100
changeset 2166 1d5a5303f15c
parent 2165 1d94f77784a0
child 2171 4eff8c9cfbbc
Improved resetting number of responding slaves.
master/fsm_master.c
master/master.c
--- a/master/fsm_master.c	Fri Dec 09 10:31:29 2011 +0100
+++ b/master/fsm_master.c	Fri Dec 09 10:35:23 2011 +0100
@@ -219,6 +219,8 @@
 
         ec_master_clear_slaves(master);
         fsm->slave_states = 0x00;
+        fsm->slaves_responding = 0; /* reset to trigger rescan on next link
+                                       up. */
     }
     fsm->link_state = master->main_device.link_state;
 
--- a/master/master.c	Fri Dec 09 10:31:29 2011 +0100
+++ b/master/master.c	Fri Dec 09 10:35:23 2011 +0100
@@ -539,6 +539,10 @@
     master->fsm_queue_locking_data = NULL;
 
     master->phase = EC_IDLE;
+
+    // reset number of responding slaves to trigger scanning
+    master->fsm.slaves_responding = 0;
+
     ret = ec_master_thread_start(master, ec_master_idle_thread,
             "EtherCAT-IDLE");
     if (ret)