Fixed compiler error on --disable-eoe.
authorFlorian Pose <fp@igh-essen.com>
Tue, 04 Aug 2009 07:54:16 +0000
changeset 1516 e3b09f847512
parent 1515 e722e0ac5d28
child 1517 b99f2f9cb73f
Fixed compiler error on --disable-eoe.
master/cdev.c
master/ioctl.h
master/master.c
master/master.h
tool/Makefile.am
tool/MasterDevice.cpp
tool/MasterDevice.h
tool/main.cpp
--- a/master/cdev.c	Thu Jul 30 14:21:28 2009 +0000
+++ b/master/cdev.c	Tue Aug 04 07:54:16 2009 +0000
@@ -171,7 +171,9 @@
     data.slave_count = master->slave_count;
     data.config_count = ec_master_config_count(master);
     data.domain_count = ec_master_domain_count(master);
+#ifdef EC_EOE
     data.eoe_handler_count = ec_master_eoe_handler_count(master);
+#endif
     data.phase = (uint8_t) master->phase;
     data.scan_busy = master->scan_busy;
     up(&master->master_sem);
@@ -1441,6 +1443,8 @@
 
 /*****************************************************************************/
 
+#ifdef EC_EOE
+
 /** Get EoE handler information.
  */
 int ec_cdev_ioctl_eoe_handler(
@@ -1486,6 +1490,8 @@
     return 0;
 }
 
+#endif
+
 /*****************************************************************************/
 
 /** Request the master from userspace.
@@ -3228,8 +3234,10 @@
             return ec_cdev_ioctl_config_pdo_entry(master, arg);
         case EC_IOCTL_CONFIG_SDO:
             return ec_cdev_ioctl_config_sdo(master, arg);
+#ifdef EC_EOE
         case EC_IOCTL_EOE_HANDLER:
             return ec_cdev_ioctl_eoe_handler(master, arg);
+#endif
         case EC_IOCTL_REQUEST:
             if (!(filp->f_mode & FMODE_WRITE))
                 return -EPERM;
--- a/master/ioctl.h	Thu Jul 30 14:21:28 2009 +0000
+++ b/master/ioctl.h	Tue Aug 04 07:54:16 2009 +0000
@@ -77,7 +77,9 @@
 #define EC_IOCTL_CONFIG_PDO           EC_IOWR(0x15, ec_ioctl_config_pdo_t)
 #define EC_IOCTL_CONFIG_PDO_ENTRY     EC_IOWR(0x16, ec_ioctl_config_pdo_entry_t)
 #define EC_IOCTL_CONFIG_SDO           EC_IOWR(0x17, ec_ioctl_config_sdo_t)
+#ifdef EC_EOE
 #define EC_IOCTL_EOE_HANDLER          EC_IOWR(0x18, ec_ioctl_eoe_handler_t)
+#endif
 
 // Application interface
 #define EC_IOCTL_REQUEST                EC_IO(0x19)
@@ -129,7 +131,9 @@
     uint32_t slave_count;
     uint32_t config_count;
     uint32_t domain_count;
+#ifdef EC_EOE
     uint32_t eoe_handler_count;
+#endif
     uint8_t phase;
     uint8_t scan_busy;
     struct {
@@ -448,6 +452,8 @@
 
 /*****************************************************************************/
 
+#ifdef EC_EOE
+
 typedef struct {
     // input
     uint16_t eoe_index;
@@ -464,6 +470,8 @@
     uint32_t tx_queue_size;
 } ec_ioctl_eoe_handler_t;
 
+#endif
+
 /*****************************************************************************/
 
 typedef struct {
--- a/master/master.c	Thu Jul 30 14:21:28 2009 +0000
+++ b/master/master.c	Tue Aug 04 07:54:16 2009 +0000
@@ -1386,6 +1386,8 @@
 
 /*****************************************************************************/
 
+#ifdef EC_EOE
+
 /** Get the number of EoE handlers.
  *
  * \return Number of EoE handlers.
@@ -1428,6 +1430,8 @@
     return NULL;
 }
 
+#endif
+
 /*****************************************************************************/
 
 /** Set the debug level.
--- a/master/master.h	Thu Jul 30 14:21:28 2009 +0000
+++ b/master/master.h	Tue Aug 04 07:54:16 2009 +0000
@@ -238,8 +238,10 @@
 ec_domain_t *ec_master_find_domain(ec_master_t *, unsigned int);
 const ec_domain_t *ec_master_find_domain_const(const ec_master_t *,
         unsigned int);
+#ifdef EC_EOE
 uint16_t ec_master_eoe_handler_count(const ec_master_t *);
 const ec_eoe_t *ec_master_get_eoe_handler_const(const ec_master_t *, uint16_t);
+#endif
 
 int ec_master_debug_level(ec_master_t *, unsigned int);
 
--- a/tool/Makefile.am	Thu Jul 30 14:21:28 2009 +0000
+++ b/tool/Makefile.am	Tue Aug 04 07:54:16 2009 +0000
@@ -27,10 +27,12 @@
 #
 #  ---
 #
-#  vim: syntax=make
+#  vim: syntax=automake
 #
 #------------------------------------------------------------------------------
 
+EXTRA_DIST =
+
 bin_PROGRAMS = ethercat
 
 ethercat_SOURCES = \
@@ -42,7 +44,6 @@
 	CommandDebug.cpp \
 	CommandDomains.cpp \
 	CommandDownload.cpp \
-	CommandEoe.cpp \
 	CommandFoeRead.cpp \
 	CommandFoeWrite.cpp \
 	CommandGraph.cpp \
@@ -65,6 +66,12 @@
 	main.cpp \
 	sii_crc.cpp
 
+if ENABLE_EOE
+ethercat_SOURCES += CommandEoe.cpp
+else
+EXTRA_DIST += CommandEoe.cpp
+endif
+
 noinst_HEADERS = \
 	Command.h \
 	CommandAlias.h \
@@ -74,7 +81,6 @@
 	CommandDebug.h \
 	CommandDomains.h \
 	CommandDownload.h \
-	CommandEoe.h \
 	CommandFoeRead.h \
 	CommandFoeWrite.h \
 	CommandGraph.h \
@@ -96,6 +102,12 @@
 	SdoCommand.h \
 	sii_crc.h
 
+if ENABLE_EOE
+noinst_HEADERS += CommandEoe.h
+else
+EXTRA_DIST += CommandEoe.h
+endif
+
 REV = `if test -s $(top_srcdir)/svnrevision; then \
 		cat $(top_srcdir)/svnrevision; \
 	else \
--- a/tool/MasterDevice.cpp	Thu Jul 30 14:21:28 2009 +0000
+++ b/tool/MasterDevice.cpp	Tue Aug 04 07:54:16 2009 +0000
@@ -485,6 +485,8 @@
 
 /****************************************************************************/
 
+#ifdef EC_EOE
+
 void MasterDevice::getEoeHandler(
         ec_ioctl_eoe_handler_t *eoe,
         uint16_t eoeHandlerIndex
@@ -499,4 +501,6 @@
     }
 }
 
+#endif
+
 /*****************************************************************************/
--- a/tool/MasterDevice.h	Thu Jul 30 14:21:28 2009 +0000
+++ b/tool/MasterDevice.h	Tue Aug 04 07:54:16 2009 +0000
@@ -117,7 +117,9 @@
 		void requestState(uint16_t, uint8_t);
 		void readFoe(ec_ioctl_slave_foe_t *);
         void writeFoe(ec_ioctl_slave_foe_t *);
+#ifdef EC_EOE
         void getEoeHandler(ec_ioctl_eoe_handler_t *, uint16_t);
+#endif
 
     private:
         unsigned int index;
--- a/tool/main.cpp	Thu Jul 30 14:21:28 2009 +0000
+++ b/tool/main.cpp	Tue Aug 04 07:54:16 2009 +0000
@@ -42,7 +42,9 @@
 #include "CommandDebug.h"
 #include "CommandDomains.h"
 #include "CommandDownload.h"
-#include "CommandEoe.h"
+#ifdef EC_EOE
+# include "CommandEoe.h"
+#endif
 #include "CommandFoeRead.h"
 #include "CommandFoeWrite.h"
 #include "CommandGraph.h"
@@ -299,7 +301,9 @@
     commandList.push_back(new CommandDebug());
     commandList.push_back(new CommandDomains());
     commandList.push_back(new CommandDownload());
+#ifdef EC_EOE
     commandList.push_back(new CommandEoe());
+#endif
     commandList.push_back(new CommandFoeRead());
     commandList.push_back(new CommandFoeWrite());
     commandList.push_back(new CommandGraph());