Skip to content

Commit

Permalink
Add USE_SOEM_CONFIG_H compile switch for "soem_config.h"
Browse files Browse the repository at this point in the history
* Only use "soem_config.h" if compile switch is on
* And restore the default timeouts, for the case USE_SOEM_CONFIG_H is not defined
* With this the default build of SOEM itself will not fail
  • Loading branch information
bnjmnp committed Dec 9, 2024
1 parent 4edaf99 commit cb9d9f4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions soem/ethercattype.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ extern "C"
#endif

#include "osal.h"
#ifdef USE_SOEM_CONFIG_H
#include "soem_config.h"
#endif

/** define EC_VER1 if version 1 default context and functions are needed
* define EC_VER2 if application uses only ecx_ functions and own context */
Expand Down Expand Up @@ -61,8 +63,22 @@ extern "C"
#define EC_ECATTYPE 0x1000
/** number of frame buffers per channel (tx, rx1 rx2) */
#define EC_MAXBUF 16


#ifndef USE_SOEM_CONFIG_H
/** timeout value in us for tx frame to return to rx */
#define EC_TIMEOUTRET 2000
/** timeout value in us for safe data transfer, max. triple retry */
#define EC_TIMEOUTRET3 (EC_TIMEOUTRET * 3)
/** timeout value in us for return "safe" variant (f.e. wireless) */
#define EC_TIMEOUTSAFE 20000
/** timeout value in us for EEPROM access */
#define EC_TIMEOUTEEP 20000
/** timeout value in us for tx mailbox cycle */
#define EC_TIMEOUTTXM 20000
/** timeout value in us for rx mailbox cycle */
#define EC_TIMEOUTRXM 700000
/** timeout value in us for check statechange */
#define EC_TIMEOUTSTATE 2000000
#endif
/** size of EEPROM bitmap cache */
#define EC_MAXEEPBITMAP 128
/** size of EEPROM cache buffer */
Expand Down

0 comments on commit cb9d9f4

Please sign in to comment.