Fixed frame statistics overflow (to be verified).
authorFlorian Pose <fp@igh-essen.com>
Sat, 31 Jul 2010 16:45:10 +0200
changeset 1956 f461dc0d145a
parent 1955 09c2bd224d3f
child 1957 b481ccf21272
child 1962 df9b00bda8dc
Fixed frame statistics overflow (to be verified).
TODO
master/device.c
tool/CommandMaster.cpp
--- a/TODO	Sat Jul 31 16:14:49 2010 +0200
+++ b/TODO	Sat Jul 31 16:45:10 2010 +0200
@@ -21,7 +21,6 @@
     - Implement ranges for slaves and domains.
 * Fix casting away constness during expected WC calculation.
 * Include SoE drive_no in ethercat tool.
-* Fix frame statistics overflow.
 
 Future issues:
 
--- a/master/device.c	Sat Jul 31 16:14:49 2010 +0200
+++ b/master/device.c	Sat Jul 31 16:45:10 2010 +0200
@@ -315,7 +315,7 @@
         u32 tx_frame_rate =
             (u32) (device->tx_count - device->last_tx_count) * 1000;
         u32 tx_byte_rate =
-            (device->tx_bytes - device->last_tx_bytes) * 1000;
+            (device->tx_bytes - device->last_tx_bytes);
         u64 loss = device->tx_count - device->rx_count;
         s32 loss_rate = (s32) (loss - device->last_loss) * 1000;
         for (i = 0; i < EC_RATE_COUNT; i++) {
--- a/tool/CommandMaster.cpp	Sat Jul 31 16:14:49 2010 +0200
+++ b/tool/CommandMaster.cpp	Sat Jul 31 16:45:10 2010 +0200
@@ -160,7 +160,7 @@
                     << setprecision(1) << fixed;
                 for (j = 0; j < EC_RATE_COUNT; j++) {
                     cout << setw(5)
-                        << data.devices[i].tx_byte_rates[j] / 1024000.0;
+                        << data.devices[i].tx_byte_rates[j] / 1024.0;
                     if (j < EC_RATE_COUNT - 1) {
                         cout << " ";
                     }