From eab47ebc4233f05406de6a395902839321cf8206 Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Tue, 18 Mar 2008 10:48:55 +0000 Subject: [PATCH] Added CoE debugging. --- master/fsm_coe.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/master/fsm_coe.c b/master/fsm_coe.c index c355ee82..45516cac 100644 --- a/master/fsm_coe.c +++ b/master/fsm_coe.c @@ -945,9 +945,11 @@ void ec_fsm_coe_down_start(ec_fsm_coe_t *fsm /**< finite state machine */) ec_sdo_request_t *request = fsm->request; uint8_t *data; - if (fsm->slave->master->debug_level) - EC_DBG("Downloading Sdo 0x%04X:%i to slave %i.\n", + if (fsm->slave->master->debug_level) { + EC_DBG("Downloading Sdo 0x%04X:%u to slave %u.\n", request->index, request->subindex, slave->ring_position); + ec_print_data(request->data, request->data_size); + } if (!(slave->sii.mailbox_protocols & EC_MBOX_COE)) { EC_ERR("Slave %u does not support CoE!\n", slave->ring_position); @@ -1166,7 +1168,7 @@ void ec_fsm_coe_up_start(ec_fsm_coe_t *fsm /**< finite state machine */) uint8_t *data; if (master->debug_level) - EC_DBG("Uploading Sdo 0x%04X:%i from slave %i.\n", + EC_DBG("Uploading Sdo 0x%04X:%u from slave %u.\n", request->index, request->subindex, slave->ring_position); if (!(slave->sii.mailbox_protocols & EC_MBOX_COE)) { @@ -1469,6 +1471,11 @@ void ec_fsm_coe_up_response(ec_fsm_coe_t *fsm /**< finite state machine */) } } + if (master->debug_level) { + EC_DBG("Uploaded data:\n"); + ec_print_data(request->data, request->data_size); + } + fsm->state = ec_fsm_coe_end; // success } @@ -1676,6 +1683,11 @@ void ec_fsm_coe_up_seg_response(ec_fsm_coe_t *fsm /**< finite state machine */) return; } + if (master->debug_level) { + EC_DBG("Uploaded data:\n"); + ec_print_data(request->data, request->data_size); + } + fsm->state = ec_fsm_coe_end; // success } -- GitLab