# HG changeset patch # User Florian Pose # Date 1171016593 0 # Node ID 5a2b1658b67fc46487cc3427fa967b24b77791b6 # Parent a729667dea1e05e3232b1fd981a07a65b691099f Introduced ECRT version magic. diff -r a729667dea1e -r 5a2b1658b67f NEWS --- 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 diff -r a729667dea1e -r 5a2b1658b67f include/ecrt.h --- 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 *****************************************************************************/ diff -r a729667dea1e -r 5a2b1658b67f master/module.c --- 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