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

Debug messaged on configuring assignment and mapping.

parent 6011c1ed
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,7 @@ void ec_fsm_pdo_assign_state_start(
}
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 @@ void ec_fsm_pdo_assign_next_dir(
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 @@ void ec_fsm_pdo_assign_next_dir(
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 @@ void ec_fsm_pdo_assign_state_pdo_count(
}
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);
......
......@@ -63,8 +63,9 @@ struct ec_fsm_pdo_assign
ec_slave_t *slave; /**< Slave the FSM runs on. */
ec_direction_t dir; /**< Current direction. */
const ec_sync_t *sync; /**< Current sync manager. */
const ec_pdo_list_t *pdos; /**< Target Pdo assignment. */
const ec_sync_t *sync; /**< Current sync manager. */
unsigned int num_configured_dirs; /**< Number of configured directions. */
const ec_pdo_t *pdo; /**< Current Pdo. */
ec_sdo_request_t request; /**< Sdo request. */
......
......@@ -149,6 +149,7 @@ void ec_fsm_pdo_mapping_state_start(
}
fsm->pdo = NULL;
fsm->num_configured_pdos = 0;
ec_fsm_pdo_mapping_next_pdo(fsm);
}
......@@ -169,7 +170,7 @@ void ec_fsm_pdo_mapping_next_pdo(
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 @@ void ec_fsm_pdo_mapping_next_pdo(
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;
}
......
......@@ -61,6 +61,7 @@ struct ec_fsm_pdo_mapping
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. */
......
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