Introduced ECRT version magic.
authorFlorian Pose <fp@igh-essen.com>
Fri, 09 Feb 2007 10:23:13 +0000
changeset 541 5a2b1658b67f
parent 540 a729667dea1e
child 542 bbcadcfb28a7
Introduced ECRT version magic.
NEWS
include/ecrt.h
master/module.c
--- a/NEWS	Fri Feb 09 10:04:05 2007 +0000
+++ b/NEWS	Fri Feb 09 10:23:13 2007 +0000
@@ -20,6 +20,7 @@
     ecrt_domain_register_pdo_list() and ecrt_domain_register_pdo_range() may
     not be NULL any more.
   - Removed ecrt_slave_pdo_size(). This function was deprecated long before.
+  - Introduced ECRT_VERSION_MAGIC macro and ecrt_version_magic() function.
 * Device interface changes:
   - ec_isr_t was replaced by ec_pollfunc_t, the device driver has to supply
     a poll function to call its ISR. This was introduced because some network
--- a/include/ecrt.h	Fri Feb 09 10:04:05 2007 +0000
+++ b/include/ecrt.h	Fri Feb 09 10:23:13 2007 +0000
@@ -59,6 +59,14 @@
 
 /*****************************************************************************/
 
+#define ECRT_VER_MAJOR 1U
+#define ECRT_VER_MINOR 2U
+
+#define ECRT_VERSION(a,b) (((a) << 8) + (b))
+#define ECRT_VERSION_MAGIC ECRT_VERSION(ECRT_VER_MAJOR, ECRT_VER_MINOR)
+
+/*****************************************************************************/
+
 struct ec_master;
 typedef struct ec_master ec_master_t; /**< \see ec_master */
 
@@ -99,6 +107,8 @@
 ec_master_t *ecrt_request_master(unsigned int master_index);
 void ecrt_release_master(ec_master_t *master);
 
+unsigned int ecrt_version_magic(void);
+
 /******************************************************************************
  *  Master methods
  *****************************************************************************/
--- a/master/module.c	Fri Feb 09 10:04:05 2007 +0000
+++ b/master/module.c	Fri Feb 09 10:23:13 2007 +0000
@@ -401,6 +401,19 @@
  *****************************************************************************/
 
 /**
+ * Returns the version magic of the realtime interface.
+ * \return ECRT version magic.
+ * \ingroup RealtimeInterface
+ */
+
+unsigned int ecrt_version_magic(void)
+{
+    return ECRT_VERSION_MAGIC;
+}
+
+/*****************************************************************************/
+
+/**
    Reserves an EtherCAT master for realtime operation.
    \return pointer to reserved master, or NULL on error
    \ingroup RealtimeInterface