SSI-Klemmen-Interface und kleinere ?nderungen.
authorFlorian Pose <fp@igh-essen.com>
Mon, 13 Feb 2006 14:11:33 +0000
changeset 66 cab9cc6a2721
parent 65 80140bace959
child 67 56964b20c15d
SSI-Klemmen-Interface und kleinere ?nderungen.
include/EtherCAT_si.h
master/canopen.c
master/master.c
master/types.c
--- a/include/EtherCAT_si.h	Fri Feb 03 16:38:43 2006 +0000
+++ b/include/EtherCAT_si.h	Mon Feb 13 14:11:33 2006 +0000
@@ -39,6 +39,17 @@
 
 /*****************************************************************************/
 
+#define EC_READ_EL5001(SLAVE) \
+    ((unsigned int) (EC_PROC_DATA(SLAVE)[1] | \
+                     (EC_PROC_DATA(SLAVE)[2] << 8) | \
+                     (EC_PROC_DATA(SLAVE)[3] << 16) | \
+                     (EC_PROC_DATA(SLAVE)[4] << 24)))
+
+#define EC_READ_EL5001_STATE(SLAVE) \
+    ((unsigned char) EC_PROC_DATA(SLAVE)[0])
+
+/*****************************************************************************/
+
 /* Emacs-Konfiguration
 ;;; Local Variables: ***
 ;;; c-basic-offset:4 ***
--- a/master/canopen.c	Fri Feb 03 16:38:43 2006 +0000
+++ b/master/canopen.c	Mon Feb 13 14:11:33 2006 +0000
@@ -19,9 +19,9 @@
 /*****************************************************************************/
 
 int EtherCAT_rt_canopen_sdo_write(ec_master_t *master, ec_slave_t *slave,
-                                        unsigned int sdo_index,
-                                        unsigned char sdo_subindex,
-                                        unsigned int value, unsigned int size)
+                                  unsigned int sdo_index,
+                                  unsigned char sdo_subindex,
+                                  unsigned int value, unsigned int size)
 {
     unsigned char data[0xF6];
     ec_command_t cmd;
--- a/master/master.c	Fri Feb 03 16:38:43 2006 +0000
+++ b/master/master.c	Mon Feb 13 14:11:33 2006 +0000
@@ -233,7 +233,7 @@
   master->command_index = (master->command_index + 1) % 0x0100;
 
   if (unlikely(master->debug_level > 0)) {
-    printk(KERN_DEBUG "EtherCAT: Sending command index %i\n", cmd->index);
+    printk(KERN_DEBUG "EtherCAT: Sending command index 0x%X\n", cmd->index);
   }
 
   cmd->state = EC_COMMAND_STATE_SENT;
--- a/master/types.c	Fri Feb 03 16:38:43 2006 +0000
+++ b/master/types.c	Mon Feb 13 14:11:33 2006 +0000
@@ -37,7 +37,7 @@
 
 unsigned char sm2_41xx[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x01, 0x00};
 
-unsigned char sm2_5001[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00};
+unsigned char sm2_5001[] = {0x00, 0x10, 0x04, 0x00, 0x24, 0x00, 0x01, 0x00};
 unsigned char sm3_5001[] = {0x00, 0x11, 0x05, 0x00, 0x20, 0x00, 0x01, 0x00};
 
 /*