# HG changeset patch # User Florian Pose # Date 1207583242 0 # Node ID 1115793a76eda439b0269ca812aae47794f65b46 # Parent 661b61ca86ed97b5f3039791b36f9ac9d62b2d28 Debug messaged on configuring assignment and mapping. diff -r 661b61ca86ed -r 1115793a76ed master/fsm_pdo_assign.c --- a/master/fsm_pdo_assign.c Mon Apr 07 15:12:43 2008 +0000 +++ b/master/fsm_pdo_assign.c Mon Apr 07 15:47:22 2008 +0000 @@ -152,6 +152,7 @@ } fsm->dir = (ec_direction_t) -1; // next is EC_DIR_OUTPUT + fsm->num_configured_dirs = 0; ec_fsm_pdo_assign_next_dir(fsm); } @@ -191,6 +192,8 @@ return; } + fsm->num_configured_dirs++; + if (fsm->slave->master->debug_level) { EC_DBG("Changing Pdo assignment for SM%u of slave %u.\n", fsm->sync->index, fsm->slave->ring_position); @@ -215,9 +218,9 @@ return; } - if (fsm->slave->master->debug_level) - EC_DBG("Pdo assignment finished for slave %u.\n", - fsm->slave->ring_position); + if (fsm->slave->master->debug_level && !fsm->num_configured_dirs) + EC_DBG("Pdo assignments of slave %u are already configured" + " correctly.\n", fsm->slave->ring_position); fsm->state = ec_fsm_pdo_assign_state_end; } @@ -348,8 +351,8 @@ } if (fsm->slave->master->debug_level) - EC_DBG("Successfully set Pdo assignment for SM%u of slave %u.\n", - fsm->sync->index, fsm->slave->ring_position); + EC_DBG("Successfully configured Pdo assignment for SM%u of" + " slave %u.\n", fsm->sync->index, fsm->slave->ring_position); // assignment for this direction finished ec_fsm_pdo_assign_next_dir(fsm); diff -r 661b61ca86ed -r 1115793a76ed master/fsm_pdo_assign.h --- a/master/fsm_pdo_assign.h Mon Apr 07 15:12:43 2008 +0000 +++ b/master/fsm_pdo_assign.h Mon Apr 07 15:47:22 2008 +0000 @@ -63,8 +63,9 @@ ec_slave_t *slave; /**< Slave the FSM runs on. */ ec_direction_t dir; /**< Current direction. */ + const ec_pdo_list_t *pdos; /**< Target Pdo assignment. */ const ec_sync_t *sync; /**< Current sync manager. */ - const ec_pdo_list_t *pdos; /**< Target Pdo assignment. */ + unsigned int num_configured_dirs; /**< Number of configured directions. */ const ec_pdo_t *pdo; /**< Current Pdo. */ ec_sdo_request_t request; /**< Sdo request. */ diff -r 661b61ca86ed -r 1115793a76ed master/fsm_pdo_mapping.c --- a/master/fsm_pdo_mapping.c Mon Apr 07 15:12:43 2008 +0000 +++ b/master/fsm_pdo_mapping.c Mon Apr 07 15:47:22 2008 +0000 @@ -149,6 +149,7 @@ } fsm->pdo = NULL; + fsm->num_configured_pdos = 0; ec_fsm_pdo_mapping_next_pdo(fsm); } @@ -169,7 +170,7 @@ list_for_each_entry(pdo, &pdos->list, list) { if (fsm->pdo) { // there was a Pdo mapping changed in the last run - if (pdo == fsm->pdo) // this is the last Pdo + if (pdo == fsm->pdo) // this is the previously configured Pdo fsm->pdo = NULL; // take the next one } else { if ((assigned_pdo = ec_slave_find_pdo(fsm->slave, pdo->index))) @@ -177,15 +178,16 @@ continue; // Pdo entries mapped correctly fsm->pdo = pdo; + fsm->num_configured_pdos++; break; } } } if (!fsm->pdo) { - if (fsm->slave->master->debug_level) - EC_DBG("Pdo mapping finished for slave %u.\n", - fsm->slave->ring_position); + if (fsm->slave->master->debug_level && !fsm->num_configured_pdos) + EC_DBG("Pdo mappings of slave %u are already configured" + " correctly.\n", fsm->slave->ring_position); fsm->state = ec_fsm_pdo_mapping_state_end; return; } diff -r 661b61ca86ed -r 1115793a76ed master/fsm_pdo_mapping.h --- a/master/fsm_pdo_mapping.h Mon Apr 07 15:12:43 2008 +0000 +++ b/master/fsm_pdo_mapping.h Mon Apr 07 15:47:22 2008 +0000 @@ -61,6 +61,7 @@ ec_slave_t *slave; /**< Slave the FSM runs on. */ const ec_pdo_t *pdo; /**< Current Pdo to configure. */ + unsigned int num_configured_pdos; /**< Number of configured Pdos. */ const ec_pdo_entry_t *entry; /**< Current entry. */ ec_sdo_request_t request; /**< Sdo request. */