diff --git a/TODO b/TODO index 242edc99277c30ab090cd289b75fd398a86939e5..b3c9849aa82fc4590921a854471a876ebd497d2a 100644 --- a/TODO +++ b/TODO @@ -16,8 +16,6 @@ Version 1.4.0: * 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 --git a/master/fsm_master.c b/master/fsm_master.c index 582a6c5e812d8123b82ec9e46f157532fa6db1dd..87b04729ae338af0e268e5ec6059236d68be7462 100644 --- a/master/fsm_master.c +++ b/master/fsm_master.c @@ -233,7 +233,6 @@ void ec_fsm_master_state_broadcast( ec_master_clear_eoe_handlers(master); #endif ec_master_clear_slaves(master); - master->configs_attached = 0; master->slave_count = fsm->slaves_responding; diff --git a/master/master.c b/master/master.c index 6606ceaf06063000627ceafb6d2256266a27964b..20b232a4799b7ac0bd5d72f42680dadab23c4e3c 100644 --- a/master/master.c +++ b/master/master.c @@ -1014,37 +1014,24 @@ void ec_master_detach_slave_configs( { 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; + ec_slave_config_attach(sc); } - - master->configs_attached = !errors; - return errors ? -1 : 0; } /*****************************************************************************/ diff --git a/master/master.h b/master/master.h index f68bb264bfed1da71ea8fc98d4250bb2867c7edf..19d9778f0fe6d607f405392ca1e9589121d85189 100644 --- a/master/master.h +++ b/master/master.h @@ -103,8 +103,7 @@ struct ec_master { 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_receive_datagrams(ec_master_t *, const uint8_t *, size_t); 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