Always set DC reference clock to OP.
authorFlorian Pose <fp@igh-essen.com>
Wed, 06 May 2009 15:06:46 +0000
changeset 1451 78fbafbf08ba
parent 1450 117f5497efd9
child 1452 b76ce77e0de2
Always set DC reference clock to OP.
TODO
master/master.c
--- a/TODO	Wed May 06 14:59:21 2009 +0000
+++ b/TODO	Wed May 06 15:06:46 2009 +0000
@@ -14,7 +14,6 @@
     - Check 32/64 bit operations.
     - Use vendor correction factors when calculating transmission delays.
     - Skip setting system time offset when application detached.
-    - Always set reference clock to OP.
     - Output DC configuration in 'ethercat config'.
     - How to set the SYNC1 shift time?
     - Do not output graph, if topology calculation failed.
--- a/master/master.c	Wed May 06 14:59:21 2009 +0000
+++ b/master/master.c	Wed May 06 15:06:46 2009 +0000
@@ -555,6 +555,7 @@
             slave++) {
         ec_slave_request_state(slave, EC_SLAVE_STATE_PREOP);
     }
+
 #ifdef EC_EOE
     // ... but set EoE slaves to OP
     list_for_each_entry(eoe, &master->eoe_handlers, list) {
@@ -1548,6 +1549,11 @@
         domain_offset += domain->data_size;
     }
     
+    // always set DC reference clock to OP
+    if (master->dc_ref_clock) {
+        ec_slave_request_state(master->dc_ref_clock, EC_SLAVE_STATE_OP);
+    }
+
     up(&master->master_sem);
 
     // restart EoE process and master thread with new locking