Kleinere Korrekturen an rt und mini.
authorFlorian Pose <fp@igh-essen.com>
Thu, 26 Jan 2006 15:52:01 +0000
changeset 62 0fb2a690f4d0
parent 61 cd014255f94f
child 63 0333d8ebfff5
Kleinere Korrekturen an rt und mini.
mini/mini.c
rt/msr_module.c
--- a/mini/mini.c	Thu Jan 26 13:41:47 2006 +0000
+++ b/mini/mini.c	Thu Jan 26 15:52:01 2006 +0000
@@ -20,11 +20,7 @@
 ec_master_t *master = NULL;
 ec_slave_t *s_in, *s_out;
 
-int value;
-int dig1;
-
 struct timer_list timer;
-unsigned long last_start_jiffies;
 
 ec_slave_init_t slaves[] = {
     // Zeiger, Index, Herstellername, Produktname, Domäne
@@ -38,20 +34,13 @@
 
 void run(unsigned long data)
 {
-    static int ms = 0;
-    static unsigned long int k = 0;
-    static int firstrun = 1;
-
-    ms++;
-    ms %= 1000;
-
+    // Klemmen-IO
     EC_WRITE_EL20XX(s_out, 3, EC_READ_EL31XX(s_in, 0) < 0);
 
     // Prozessdaten lesen und schreiben
-    rdtscl(k);
     EtherCAT_rt_domain_xio(master, 1, 100);
-    firstrun = 0;
 
+    // Timer neu starten
     timer.expires += HZ / 1000;
     add_timer(&timer);
 }
@@ -67,8 +56,6 @@
         goto out_return;
     }
 
-    //EtherCAT_rt_debug_level(master, 2);
-
     if (EtherCAT_rt_register_slave_list(master, slaves, SLAVE_COUNT)) {
         printk(KERN_ERR "Could not register slaves!\n");
         goto out_release_master;
@@ -86,13 +73,9 @@
     init_timer(&timer);
 
     timer.function = run;
-    timer.data = 0;
     timer.expires = jiffies + 10; // Das erste Mal sofort feuern
-    last_start_jiffies = timer.expires;
     add_timer(&timer);
 
-    printk("Initialised sample thread.\n");
-
     printk(KERN_INFO "=== Minimal EtherCAT environment started. ===\n");
 
     return 0;
--- a/rt/msr_module.c	Thu Jan 26 13:41:47 2006 +0000
+++ b/rt/msr_module.c	Thu Jan 26 15:52:01 2006 +0000
@@ -58,9 +58,9 @@
 int dig1;
 
 ec_slave_init_t slaves[] = {
-    {&s_in1, 1, "Beckhoff", "EL3102", 0},
-    {&s_out1, 8, "Beckhoff", "EL2004", 0},
-    {&s_out2, 9, "Beckhoff", "EL2004", 0},
+    {&s_in1,   1, "Beckhoff", "EL3102", 0},
+    {&s_out1,  8, "Beckhoff", "EL2004", 0},
+    {&s_out2,  9, "Beckhoff", "EL2004", 0},
     {&s_out3, 10, "Beckhoff", "EL2004", 0}
 };