Slave interface und Makefile ge?ndert.
authorFlorian Pose <fp@igh-essen.com>
Mon, 20 Feb 2006 08:36:03 +0000
changeset 71 79d7b9cfdeb9
parent 70 6693d7e25d5e
child 72 7c986b717411
Slave interface und Makefile ge?ndert.
Makefile
include/EtherCAT_si.h
--- a/Makefile	Mon Feb 20 08:30:30 2006 +0000
+++ b/Makefile	Mon Feb 20 08:36:03 2006 +0000
@@ -13,7 +13,7 @@
 #------------------------------------------------------------------------------
 # Kbuild-Abschnitt
 
-obj-m := master/ devices/ rt/ mini/
+obj-m := master/ devices/
 
 #------------------------------------------------------------------------------
 
@@ -22,7 +22,11 @@
 #------------------------------------------------------------------------------
 # Default-Abschnitt
 
+ifneq ($(wildcard ethercat.conf),)
 include ethercat.conf
+else
+KERNELDIR := /usr/src/linux
+endif
 
 modules:
 	$(MAKE) -C $(KERNELDIR) M=`pwd`
--- a/include/EtherCAT_si.h	Mon Feb 20 08:30:30 2006 +0000
+++ b/include/EtherCAT_si.h	Mon Feb 20 08:36:03 2006 +0000
@@ -17,7 +17,7 @@
 
 /*****************************************************************************/
 
-#define EC_WRITE_EL20XX(SLAVE, CHANNEL, VALUE) \
+#define EC_WRITE_EL200X(SLAVE, CHANNEL, VALUE) \
     do { \
         if (VALUE) EC_PROC_DATA(SLAVE)[0] |=  (1 << (CHANNEL)); \
         else       EC_PROC_DATA(SLAVE)[0] &= ~(1 << (CHANNEL)); \
@@ -25,13 +25,17 @@
 
 /*****************************************************************************/
 
-#define EC_READ_EL31XX(SLAVE, CHANNEL) \
-    ((short int) ((EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 2] << 8) | \
-                   EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 1]))
+#define EC_READ_EL310X(SLAVE, CHANNEL) \
+    ((signed short int) ((EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 2] << 8) | \
+                          EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 1]))
+
+#define EC_READ_EL316X(SLAVE, CHANNEL) \
+    ((unsigned short int) ((EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 2] << 8) | \
+                            EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 1]))
 
 /*****************************************************************************/
 
-#define EC_WRITE_EL41XX(SLAVE, CHANNEL, VALUE) \
+#define EC_WRITE_EL410X(SLAVE, CHANNEL, VALUE) \
     do { \
         EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 1] = ((VALUE) & 0xFF00) >> 8; \
         EC_PROC_DATA(SLAVE)[(CHANNEL) * 3 + 2] =  (VALUE) & 0xFF; \