Skip to content
Snippets Groups Projects
Commit b3242ef8 authored by Florian Pose's avatar Florian Pose
Browse files

Fixed lost frames display bug when no frames were sent.

parent 69f7a400
No related branches found
No related tags found
No related merge requests found
...@@ -842,6 +842,7 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */ ...@@ -842,6 +842,7 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */
off_t off = 0; off_t off = 0;
ec_eoe_t *eoe; ec_eoe_t *eoe;
uint32_t cur, sum, min, max, pos, i; uint32_t cur, sum, min, max, pos, i;
unsigned int frames_lost;
off += sprintf(buffer + off, "\nVersion: %s", ec_master_version_str); off += sprintf(buffer + off, "\nVersion: %s", ec_master_version_str);
off += sprintf(buffer + off, "\nMode: "); off += sprintf(buffer + off, "\nMode: ");
...@@ -864,8 +865,9 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */ ...@@ -864,8 +865,9 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */
master->device->tx_count); master->device->tx_count);
off += sprintf(buffer + off, " Frames received: %u\n", off += sprintf(buffer + off, " Frames received: %u\n",
master->device->rx_count); master->device->rx_count);
off += sprintf(buffer + off, " Frames lost: %u\n", frames_lost = master->device->tx_count - master->device->rx_count;
master->device->tx_count - master->device->rx_count - 1); if (frames_lost) frames_lost--;
off += sprintf(buffer + off, " Frames lost: %u\n", frames_lost);
off += sprintf(buffer + off, "\nTiming (min/avg/max) [us]:\n"); off += sprintf(buffer + off, "\nTiming (min/avg/max) [us]:\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment