MERGE trunk -r354:355 -> branches/stable-1.0 (version numbers) stable-1.0
authorFlorian Pose <fp@igh-essen.com>
Thu, 20 Apr 2006 14:38:41 +0000
branchstable-1.0
changeset 1617 9f83a343ae75
parent 1616 f009a710e8a3
child 1618 5cff10efb927
MERGE trunk -r354:355 -> branches/stable-1.0 (version numbers)
devices/Makefile
master/Makefile
master/globals.h
master/module.c
--- a/devices/Makefile	Thu Apr 20 13:38:48 2006 +0000
+++ b/devices/Makefile	Thu Apr 20 14:38:41 2006 +0000
@@ -17,7 +17,9 @@
 
 ec_8139too-objs := 8139too.o
 
-EXTRA_CFLAGS = -DEC_REV="$(shell svnversion $(src))" -DEC_USER="$(USER)"
+REV := $(shell svnversion $(src) 2>/dev/null)
+
+EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
 
 #------------------------------------------------------------------------------
 
--- a/master/Makefile	Thu Apr 20 13:38:48 2006 +0000
+++ b/master/Makefile	Thu Apr 20 14:38:41 2006 +0000
@@ -18,7 +18,9 @@
 ec_master-objs := module.o master.o device.o slave.o command.o types.o \
 			domain.o mailbox.o canopen.o ethernet.o
 
-EXTRA_CFLAGS := -DSVNREV=$(shell svnversion $(src)) -DUSER=$(USER)
+REV := $(shell svnversion $(src) 2>/dev/null)
+
+EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER)
 
 #------------------------------------------------------------------------------
 
--- a/master/globals.h	Thu Apr 20 13:38:48 2006 +0000
+++ b/master/globals.h	Thu Apr 20 14:38:41 2006 +0000
@@ -13,23 +13,45 @@
 
 #include <linux/types.h>
 
-/*****************************************************************************/
+/******************************************************************************
+ *  EtherCAT master
+ *****************************************************************************/
 
-// EtherCAT-Protokoll
-#define EC_MAX_FRAME_SIZE 1500 /**< maximum size of an EtherCAT frame (without
-                                header and CRC) */
-#define EC_MIN_FRAME_SIZE 46 /** ... minimum size */
-#define EC_FRAME_HEADER_SIZE 2 /**< size of an EtherCAT frame header */
-#define EC_COMMAND_HEADER_SIZE 10 /**< size of an EtherCAT command header */
-#define EC_COMMAND_FOOTER_SIZE 2 /**< size of an EtherCAT command footer */
-#define EC_SYNC_SIZE 8 /**< size of a sync manager configuration page */
-#define EC_FMMU_SIZE 16 /**< size of an FMMU configuration page */
-#define EC_MAX_FMMUS 16 /**< maximum number of FMMUs per slave */
-#define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE \
-                          - EC_FRAME_HEADER_SIZE \
-                          - EC_COMMAND_HEADER_SIZE \
-                          - EC_COMMAND_FOOTER_SIZE) /**< maximum data size of a
-                                                       single command */
+#define EC_MASTER_VERSION_MAIN  1
+#define EC_MASTER_VERSION_SUB   0
+#define EC_MASTER_VERSION_EXTRA "stable"
+
+/** maximum number of FMMUs per slave */
+#define EC_MAX_FMMUS 16
+
+/******************************************************************************
+ *  EtherCAT protocol
+ *****************************************************************************/
+
+/** maximum size of an EtherCAT frame (without header and CRC) */
+#define EC_MAX_FRAME_SIZE 1500
+
+/** ... minimum size */
+#define EC_MIN_FRAME_SIZE 46
+
+/** size of an EtherCAT frame header */
+#define EC_FRAME_HEADER_SIZE 2
+
+/** size of an EtherCAT command header */
+#define EC_COMMAND_HEADER_SIZE 10
+
+/** size of an EtherCAT command footer */
+#define EC_COMMAND_FOOTER_SIZE 2
+
+/** size of a sync manager configuration page */
+#define EC_SYNC_SIZE 8
+
+/** size of an FMMU configuration page */
+#define EC_FMMU_SIZE 16
+
+/** resulting maximum data size of a single command in a frame */
+#define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE - EC_FRAME_HEADER_SIZE \
+                          - EC_COMMAND_HEADER_SIZE - EC_COMMAND_FOOTER_SIZE)
 
 /*****************************************************************************/
 
--- a/master/module.c	Thu Apr 20 13:38:48 2006 +0000
+++ b/master/module.c	Thu Apr 20 14:38:41 2006 +0000
@@ -33,7 +33,10 @@
 
 /*****************************************************************************/
 
-#define COMPILE_INFO "Revision " EC_STR(SVNREV) \
+#define COMPILE_INFO EC_STR(EC_MASTER_VERSION_MAIN) \
+                     "." EC_STR(EC_MASTER_VERSION_SUB) \
+                     " (" EC_MASTER_VERSION_EXTRA ")" \
+                     " - rev. " EC_STR(SVNREV) \
                      ", compiled by " EC_STR(USER) \
                      " at " __DATE__ " " __TIME__
 
@@ -149,6 +152,54 @@
     return NULL;
 }
 
+/*****************************************************************************/
+
+/**
+   Outputs frame contents for debugging purposes.
+*/
+
+void ec_print_data(const uint8_t *data, /**< pointer to data */
+                   size_t size /**< number of bytes to output */
+                   )
+{
+    unsigned int i;
+
+    EC_DBG("");
+    for (i = 0; i < size; i++) {
+        printk("%02X ", data[i]);
+        if ((i + 1) % 16 == 0) {
+            printk("\n");
+            EC_DBG("");
+        }
+    }
+    printk("\n");
+}
+
+/*****************************************************************************/
+
+/**
+   Outputs frame contents and differences for debugging purposes.
+*/
+
+void ec_print_data_diff(const uint8_t *d1, /**< first data */
+                        const uint8_t *d2, /**< second data */
+                        size_t size /** number of bytes to output */
+                        )
+{
+    unsigned int i;
+
+    EC_DBG("");
+    for (i = 0; i < size; i++) {
+        if (d1[i] == d2[i]) printk(".. ");
+        else printk("%02X ", d2[i]);
+        if ((i + 1) % 16 == 0) {
+            printk("\n");
+            EC_DBG("");
+        }
+    }
+    printk("\n");
+}
+
 /******************************************************************************
  *  Device interface
  *****************************************************************************/
@@ -354,54 +405,6 @@
 
 /*****************************************************************************/
 
-/**
-   Outputs frame contents for debugging purposes.
-*/
-
-void ec_print_data(const uint8_t *data, /**< pointer to data */
-                   size_t size /**< number of bytes to output */
-                   )
-{
-    unsigned int i;
-
-    EC_DBG("");
-    for (i = 0; i < size; i++) {
-        printk("%02X ", data[i]);
-        if ((i + 1) % 16 == 0) {
-            printk("\n");
-            EC_DBG("");
-        }
-    }
-    printk("\n");
-}
-
-/*****************************************************************************/
-
-/**
-   Outputs frame contents and differences for debugging purposes.
-*/
-
-void ec_print_data_diff(const uint8_t *d1, /**< first data */
-                        const uint8_t *d2, /**< second data */
-                        size_t size /** number of bytes to output */
-                        )
-{
-    unsigned int i;
-
-    EC_DBG("");
-    for (i = 0; i < size; i++) {
-        if (d1[i] == d2[i]) printk(".. ");
-        else printk("%02X ", d2[i]);
-        if ((i + 1) % 16 == 0) {
-            printk("\n");
-            EC_DBG("");
-        }
-    }
-    printk("\n");
-}
-
-/*****************************************************************************/
-
 module_init(ec_init_module);
 module_exit(ec_cleanup_module);