Skip to content
Snippets Groups Projects
Commit 4a9d9faa authored by Florian Pose's avatar Florian Pose
Browse files

Output attachment failure messages only when debugging.

parent 0e530653
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,6 @@ Version 1.4.0: ...@@ -10,8 +10,6 @@ Version 1.4.0:
* Remove get_cycles() calls and references to cpu_khz to increase * Remove get_cycles() calls and references to cpu_khz to increase
portability. portability.
* Make ecrt_master_slave_config() return no error when slave is not present
or invalid.
* Make scanning and configuration run parallel (each). * Make scanning and configuration run parallel (each).
* Adapt remaining examples. * Adapt remaining examples.
* READMEs for examples. * READMEs for examples.
......
...@@ -174,37 +174,39 @@ int ec_slave_config_attach( ...@@ -174,37 +174,39 @@ int ec_slave_config_attach(
if (!(slave = ec_master_find_slave( if (!(slave = ec_master_find_slave(
sc->master, sc->alias, sc->position))) { sc->master, sc->alias, sc->position))) {
EC_WARN("Failed to find slave for configuration %u:%u.\n", if (sc->master->debug_level)
sc->alias, sc->position); EC_DBG("Failed to find slave for configuration %u:%u.\n",
sc->alias, sc->position);
return -1; return -1;
} }
if (slave->config) { if (slave->config) {
EC_ERR("Failed to attach slave configuration %u:%u. Slave %u" if (sc->master->debug_level)
" already has a configuration!\n", sc->alias, EC_DBG("Failed to attach slave configuration %u:%u. Slave %u"
sc->position, slave->ring_position); " already has a configuration!\n", sc->alias,
return -2; sc->position, slave->ring_position);
} return -2;
if (slave->sii.vendor_id != sc->vendor_id }
|| slave->sii.product_code != sc->product_code) { if (slave->sii.vendor_id != sc->vendor_id
EC_ERR("Slave %u has an invalid type (0x%08X/0x%08X) for" || slave->sii.product_code != sc->product_code) {
" configuration %u:%u (0x%08X/0x%08X).\n", if (sc->master->debug_level)
slave->ring_position, slave->sii.vendor_id, EC_DBG("Slave %u has an invalid type (0x%08X/0x%08X) for"
slave->sii.product_code, sc->alias, sc->position, " configuration %u:%u (0x%08X/0x%08X).\n",
sc->vendor_id, sc->product_code); slave->ring_position, slave->sii.vendor_id,
return -3; slave->sii.product_code, sc->alias, sc->position,
sc->vendor_id, sc->product_code);
return -3;
} }
// attach slave // attach slave
slave->config = sc; slave->config = sc;
sc->slave = slave; sc->slave = slave;
ec_slave_request_state(slave, EC_SLAVE_STATE_OP);
if (sc->master->debug_level) if (sc->master->debug_level)
EC_DBG("Attached slave %u to config %u:%u.\n", EC_DBG("Attached slave %u to config %u:%u.\n",
slave->ring_position, sc->alias, sc->position); slave->ring_position, sc->alias, sc->position);
ec_slave_request_state(slave, EC_SLAVE_STATE_OP);
return 0; return 0;
} }
...@@ -259,14 +261,16 @@ void ec_slave_config_load_default_mapping( ...@@ -259,14 +261,16 @@ void ec_slave_config_load_default_mapping(
" config %u:%u.\n", pdo->index, sc->alias, sc->position); " config %u:%u.\n", pdo->index, sc->alias, sc->position);
if (!sc->slave) { if (!sc->slave) {
EC_WARN("Failed to load default Pdo configuration for %u:%u:" if (sc->master->debug_level)
" Slave not found.\n", sc->alias, sc->position); EC_DBG("Failed to load default Pdo configuration for %u:%u:"
" Slave not found.\n", sc->alias, sc->position);
return; return;
} }
if (!(sync = ec_slave_get_pdo_sync(sc->slave, pdo->dir))) { if (!(sync = ec_slave_get_pdo_sync(sc->slave, pdo->dir))) {
EC_WARN("Slave %u does not provide a default Pdo" if (sc->master->debug_level)
" configuration!\n", sc->slave->ring_position); EC_DBG("Slave %u does not provide a default Pdo"
" configuration!\n", sc->slave->ring_position);
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment