Added debugging for sdo download.

This commit is contained in:
Florian Pose 2008-06-09 12:35:00 +00:00
parent 4c1696d415
commit e654535c2d
1 changed files with 10 additions and 0 deletions

View File

@ -1029,6 +1029,11 @@ void ec_fsm_coe_down_start(ec_fsm_coe_t *fsm /**< finite state machine */)
EC_WRITE_U32(data + 6, request->data_size);
memcpy(data + 10, request->data, request->data_size);
if (slave->master->debug_level) {
EC_DBG("Download request:\n");
ec_print_data(data, 10 + request->data_size);
}
fsm->retries = EC_FSM_RETRIES;
fsm->state = ec_fsm_coe_down_request;
}
@ -1175,6 +1180,11 @@ void ec_fsm_coe_down_response(ec_fsm_coe_t *fsm /**< finite state machine */)
return;
}
if (slave->master->debug_level) {
EC_DBG("Download response:\n");
ec_print_data(data, rec_size);
}
if (rec_size < 6) {
fsm->state = ec_fsm_coe_error;
EC_ERR("Received data is too small (%u bytes):\n", rec_size);