Added CoE debugging.
authorFlorian Pose <fp@igh-essen.com>
Tue, 18 Mar 2008 10:48:55 +0000
changeset 874 022f869ea40f
parent 873 ec01ba291896
child 875 c5df898a3618
Added CoE debugging.
master/fsm_coe.c
--- a/master/fsm_coe.c	Mon Mar 17 14:16:16 2008 +0000
+++ b/master/fsm_coe.c	Tue Mar 18 10:48:55 2008 +0000
@@ -945,9 +945,11 @@
     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 @@
     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 @@
         }
     }
 
+    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 @@
         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
 }