Added EC_EOE_FREQUENCY
authorFlorian Pose <fp@igh-essen.com>
Wed, 10 May 2006 13:56:23 +0000
changeset 228 ec516cfa207e
parent 227 413ae15d330e
child 229 2cc0a7146958
Added EC_EOE_FREQUENCY
master/globals.h
master/master.c
--- a/master/globals.h	Wed May 10 11:51:36 2006 +0000
+++ b/master/globals.h	Wed May 10 13:56:23 2006 +0000
@@ -52,6 +52,9 @@
 /** size of the EoE tx queue */
 #define EC_EOE_TX_QUEUE_SIZE 100
 
+/** clock frequency for the EoE state machines */
+#define EC_EOE_FREQUENCY 1000
+
 /******************************************************************************
  *  EtherCAT protocol
  *****************************************************************************/
--- a/master/master.c	Wed May 10 11:51:36 2006 +0000
+++ b/master/master.c	Wed May 10 13:56:23 2006 +0000
@@ -876,22 +876,23 @@
     ec_eoe_t *eoe;
 
     // request_cb must return 0, if the lock has been aquired!
-    if (master->request_cb(master->cb_data)) goto queue;
-
-    ecrt_master_async_receive(master);
-    list_for_each_entry(eoe, &master->eoe_slaves, list) {
-      ec_eoe_run(eoe);
-    }
-    ecrt_master_async_send(master);
-
-    master->release_cb(master->cb_data);
-
- queue:
+    if (!master->request_cb(master->cb_data))
+    {
+        ecrt_master_async_receive(master);
+        list_for_each_entry(eoe, &master->eoe_slaves, list) {
+            ec_eoe_run(eoe);
+        }
+        ecrt_master_async_send(master);
+
+        master->release_cb(master->cb_data);
+    }
+
 #ifdef EOE_TIMER
-    master->eoe_timer.expires += HZ / 1000;
+    master->eoe_timer.expires += HZ / EC_EOE_FREQUENCY;
     add_timer(&master->eoe_timer);
 #else
-    queue_delayed_work(master->eoe_workqueue, &master->eoe_work, HZ / 1000);
+    queue_delayed_work(master->eoe_workqueue, &master->eoe_work,
+                       HZ / EC_EOE_FREQUENCY);
 #endif
 }