diff --git a/master/cdev.c b/master/cdev.c index 0acf642d..a60e87d7 100644 --- a/master/cdev.c +++ b/master/cdev.c @@ -171,7 +171,9 @@ int ec_cdev_ioctl_master( 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 @@ int ec_cdev_ioctl_config_sdo( /*****************************************************************************/ +#ifdef EC_EOE + /** Get EoE handler information. */ int ec_cdev_ioctl_eoe_handler( @@ -1486,6 +1490,8 @@ int ec_cdev_ioctl_eoe_handler( return 0; } +#endif + /*****************************************************************************/ /** Request the master from userspace. @@ -3228,8 +3234,10 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 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; diff --git a/master/ioctl.h b/master/ioctl.h index 0661d63d..c1785d71 100644 --- a/master/ioctl.h +++ b/master/ioctl.h @@ -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 @@ typedef struct { 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 @@ typedef struct { /*****************************************************************************/ +#ifdef EC_EOE + typedef struct { // input uint16_t eoe_index; @@ -464,6 +470,8 @@ typedef struct { uint32_t tx_queue_size; } ec_ioctl_eoe_handler_t; +#endif + /*****************************************************************************/ typedef struct { diff --git a/master/master.c b/master/master.c index 952c1e16..263cba0a 100644 --- a/master/master.c +++ b/master/master.c @@ -1386,6 +1386,8 @@ const ec_domain_t *ec_master_find_domain_const( /*****************************************************************************/ +#ifdef EC_EOE + /** Get the number of EoE handlers. * * \return Number of EoE handlers. @@ -1428,6 +1430,8 @@ const ec_eoe_t *ec_master_get_eoe_handler_const( return NULL; } +#endif + /*****************************************************************************/ /** Set the debug level. diff --git a/master/master.h b/master/master.h index 225ccbb0..80702767 100644 --- a/master/master.h +++ b/master/master.h @@ -238,8 +238,10 @@ unsigned int ec_master_domain_count(const ec_master_t *); 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); diff --git a/tool/Makefile.am b/tool/Makefile.am index 30d70700..5ea7eeb7 100644 --- a/tool/Makefile.am +++ b/tool/Makefile.am @@ -27,10 +27,12 @@ # # --- # -# vim: syntax=make +# vim: syntax=automake # #------------------------------------------------------------------------------ +EXTRA_DIST = + bin_PROGRAMS = ethercat ethercat_SOURCES = \ @@ -42,7 +44,6 @@ ethercat_SOURCES = \ CommandDebug.cpp \ CommandDomains.cpp \ CommandDownload.cpp \ - CommandEoe.cpp \ CommandFoeRead.cpp \ CommandFoeWrite.cpp \ CommandGraph.cpp \ @@ -65,6 +66,12 @@ ethercat_SOURCES = \ 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 @@ noinst_HEADERS = \ CommandDebug.h \ CommandDomains.h \ CommandDownload.h \ - CommandEoe.h \ CommandFoeRead.h \ CommandFoeWrite.h \ CommandGraph.h \ @@ -96,6 +102,12 @@ noinst_HEADERS = \ 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 \ diff --git a/tool/MasterDevice.cpp b/tool/MasterDevice.cpp index 1165c5e5..c9b12854 100644 --- a/tool/MasterDevice.cpp +++ b/tool/MasterDevice.cpp @@ -485,6 +485,8 @@ void MasterDevice::requestState( /****************************************************************************/ +#ifdef EC_EOE + void MasterDevice::getEoeHandler( ec_ioctl_eoe_handler_t *eoe, uint16_t eoeHandlerIndex @@ -499,4 +501,6 @@ void MasterDevice::getEoeHandler( } } +#endif + /*****************************************************************************/ diff --git a/tool/MasterDevice.h b/tool/MasterDevice.h index 5f9072a9..cd5f87a8 100644 --- a/tool/MasterDevice.h +++ b/tool/MasterDevice.h @@ -117,7 +117,9 @@ class MasterDevice 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; diff --git a/tool/main.cpp b/tool/main.cpp index 64d2ada1..1827cf28 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -42,7 +42,9 @@ using namespace std; #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 @@ int main(int argc, char **argv) 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());