Fixed frame statistics overflow (to be verified).

This commit is contained in:
Florian Pose 2010-07-31 16:45:10 +02:00
parent b9c119817d
commit ba64ed28fc
3 changed files with 2 additions and 3 deletions

1
TODO
View File

@ -21,7 +21,6 @@ Version 1.5.0:
- Implement ranges for slaves and domains. - Implement ranges for slaves and domains.
* Fix casting away constness during expected WC calculation. * Fix casting away constness during expected WC calculation.
* Include SoE drive_no in ethercat tool. * Include SoE drive_no in ethercat tool.
* Fix frame statistics overflow.
Future issues: Future issues:

View File

@ -315,7 +315,7 @@ void ec_device_send(
u32 tx_frame_rate = u32 tx_frame_rate =
(u32) (device->tx_count - device->last_tx_count) * 1000; (u32) (device->tx_count - device->last_tx_count) * 1000;
u32 tx_byte_rate = 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; u64 loss = device->tx_count - device->rx_count;
s32 loss_rate = (s32) (loss - device->last_loss) * 1000; s32 loss_rate = (s32) (loss - device->last_loss) * 1000;
for (i = 0; i < EC_RATE_COUNT; i++) { for (i = 0; i < EC_RATE_COUNT; i++) {

View File

@ -160,7 +160,7 @@ void CommandMaster::execute(const StringVector &args)
<< setprecision(1) << fixed; << setprecision(1) << fixed;
for (j = 0; j < EC_RATE_COUNT; j++) { for (j = 0; j < EC_RATE_COUNT; j++) {
cout << setw(5) 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) { if (j < EC_RATE_COUNT - 1) {
cout << " "; cout << " ";
} }