Remove estimated sync manager sizes when leaving operation mode.
authorFlorian Pose <fp@igh-essen.com>
Mon, 30 Oct 2006 15:39:03 +0000
changeset 467 2274de57ca84
parent 466 5f3758fdc3b5
child 468 22de19c004a7
Remove estimated sync manager sizes when leaving operation mode.
master/master.c
master/slave.c
--- a/master/master.c	Fri Oct 27 15:07:01 2006 +0000
+++ b/master/master.c	Mon Oct 30 15:39:03 2006 +0000
@@ -433,6 +433,7 @@
 
     // set states for all slaves
     list_for_each_entry(slave, &master->slaves, list) {
+        ec_slave_reset(slave);
         ec_slave_request_state(slave, EC_SLAVE_STATE_PREOP);
 
         fsm->slave = slave;
@@ -452,10 +453,6 @@
     master->release_cb = NULL;
     master->cb_data = NULL;
 
-    list_for_each_entry(slave, &master->slaves, list) {
-        ec_slave_reset(slave);
-    }
-
     master->mode = EC_MASTER_MODE_IDLE;
     queue_delayed_work(master->workqueue, &master->idle_work, 1);
 }
--- a/master/slave.c	Fri Oct 27 15:07:01 2006 +0000
+++ b/master/slave.c	Mon Oct 30 15:39:03 2006 +0000
@@ -284,6 +284,7 @@
 void ec_slave_reset(ec_slave_t *slave /**< EtherCAT slave */)
 {
     ec_sdo_data_t *sdodata, *next_sdodata;
+    ec_sii_sync_t *sync;
 
     // remove FMMU configurations
     slave->fmmu_count = 0;
@@ -294,6 +295,11 @@
         kfree(sdodata->data);
         kfree(sdodata);
     }
+
+    // remove estimated sync manager sizes
+    list_for_each_entry(sync, &slave->sii_syncs, list) {
+        sync->est_length = 0;
+    }
 }
 
 /*****************************************************************************/