Skip to content

Commit

Permalink
Add extra ERROR on mailbox receive timeout to improv diagnostics poss…
Browse files Browse the repository at this point in the history
…ibilities
  • Loading branch information
Andreas Karlsson committed May 24, 2019
1 parent 9c921d8 commit 8c1e83e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion soem/ethercatmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ int ecx_mbxreceive(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int tim
}
else /* no read mailbox available */
{
wkc = 0;
if (wkc > 0)
wkc = EC_TIMEOUT;
}
}

Expand Down
2 changes: 2 additions & 0 deletions soem/ethercattype.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ extern "C"
#define EC_ERROR -3
/** return value too many slaves */
#define EC_SLAVECOUNTEXCEEDED -4
/** return value request timeout */
#define EC_TIMEOUT -5
/** maximum EtherCAT frame length in bytes */
#define EC_MAXECATFRAME 1518
/** maximum EtherCAT LRW frame length in bytes */
Expand Down

0 comments on commit 8c1e83e

Please sign in to comment.