# HG changeset patch # User Florian Pose # Date 1213793351 0 # Node ID afdd4bdbb7ecf33be50674cd8d5c174a685ceda4 # Parent 9d37c6d3c80bbbd89ce1e34dbdd6cfc0e7651414 Removed configs_attached flag; changed return value of ec_master_attach_slave_configs() to void. diff -r 9d37c6d3c80b -r afdd4bdbb7ec TODO --- a/TODO Wed Jun 18 11:24:31 2008 +0000 +++ b/TODO Wed Jun 18 12:49:11 2008 +0000 @@ -16,8 +16,6 @@ * Update documentation. * Check for sizes of uploaded Sdos when reading mapping from CoE. * Attach Pdo names from SII or Coe dictioary to Pdos read via CoE. -* List of commands that require a slave. -* Remove configs_attached flag. * Rename master MODE to STATE. * Remove the end state of the master state machine. * Add a -n (numeric) switch to ethercat command. diff -r 9d37c6d3c80b -r afdd4bdbb7ec master/fsm_master.c --- a/master/fsm_master.c Wed Jun 18 11:24:31 2008 +0000 +++ b/master/fsm_master.c Wed Jun 18 12:49:11 2008 +0000 @@ -233,7 +233,6 @@ ec_master_clear_eoe_handlers(master); #endif ec_master_clear_slaves(master); - master->configs_attached = 0; master->slave_count = fsm->slaves_responding; diff -r 9d37c6d3c80b -r afdd4bdbb7ec master/master.c --- a/master/master.c Wed Jun 18 11:24:31 2008 +0000 +++ b/master/master.c Wed Jun 18 12:49:11 2008 +0000 @@ -1014,37 +1014,24 @@ { ec_slave_config_t *sc; - if (!master->configs_attached) - return; - list_for_each_entry(sc, &master->configs, list) { ec_slave_config_detach(sc); } - - master->configs_attached = 0; } /*****************************************************************************/ /** Attaches the slave configurations to the slaves. */ -int ec_master_attach_slave_configs( +void ec_master_attach_slave_configs( ec_master_t *master /**< EtherCAT master. */ ) { ec_slave_config_t *sc; - unsigned int errors = 0; - - if (master->configs_attached) - return 0; list_for_each_entry(sc, &master->configs, list) { - if (ec_slave_config_attach(sc)) - errors = 1; - } - - master->configs_attached = !errors; - return errors ? -1 : 0; + ec_slave_config_attach(sc); + } } /*****************************************************************************/ diff -r 9d37c6d3c80b -r afdd4bdbb7ec master/master.h --- a/master/master.h Wed Jun 18 11:24:31 2008 +0000 +++ b/master/master.h Wed Jun 18 12:49:11 2008 +0000 @@ -103,8 +103,7 @@ ec_slave_t *slaves; /**< Array of slaves on the bus. */ unsigned int slave_count; /**< Number of slaves on the bus. */ - struct list_head configs; /**< Bus configuration list. */ - unsigned int configs_attached; /**< Slave configurations were attached. */ + struct list_head configs; /**< List of slave configurations. */ unsigned int scan_busy; /**< Current scan state. */ unsigned int allow_scan; /**< non-zero, if slave scanning is allowed */ @@ -188,7 +187,7 @@ void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *); // misc. -int ec_master_attach_slave_configs(ec_master_t *); +void ec_master_attach_slave_configs(ec_master_t *); ec_slave_t *ec_master_find_slave(ec_master_t *, uint16_t, uint16_t); void ec_master_output_stats(ec_master_t *); #ifdef EC_EOE