Added debugging output for unmatched frames and those that timed out.
--- a/master/master.c Tue Aug 07 13:33:21 2007 +0000
+++ b/master/master.c Tue Aug 07 13:33:57 2007 +0000
@@ -718,6 +718,14 @@
if (!matched) {
master->stats.unmatched++;
ec_master_output_stats(master);
+
+ if (unlikely(master->debug_level > 0)) {
+ EC_DBG("UNMATCHED datagram:\n");
+ ec_print_data(cur_data - EC_DATAGRAM_HEADER_SIZE,
+ EC_DATAGRAM_HEADER_SIZE + data_size
+ + EC_DATAGRAM_FOOTER_SIZE);
+ }
+
cur_data += data_size + EC_DATAGRAM_FOOTER_SIZE;
continue;
}
@@ -1504,6 +1512,13 @@
datagram->state = EC_DATAGRAM_TIMED_OUT;
master->stats.timeouts++;
ec_master_output_stats(master);
+
+ if (unlikely(master->debug_level > 0)) {
+ EC_DBG("TIMED OUT datagram index %02X waited %u us.\n",
+ datagram->index,
+ (unsigned int) (master->main_device.cycles_poll
+ - datagram->cycles_sent) * 1000 / cpu_khz);
+ }
}
}