From 9c921d8d4e29771f5a1a48f975a494c60611760a Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Fri, 24 May 2019 14:05:53 +0200 Subject: [PATCH] Make ERROR slave count exceeded unique --- soem/ethercatconfig.c | 2 +- soem/ethercattype.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/soem/ethercatconfig.c b/soem/ethercatconfig.c index 923ffbf..08a6ab0 100644 --- a/soem/ethercatconfig.c +++ b/soem/ethercatconfig.c @@ -142,7 +142,7 @@ int ecx_detect_slaves(ecx_contextt *context) { EC_PRINT("Error: too many slaves on network: num_slaves=%d, EC_MAXSLAVE=%d\n", wkc, EC_MAXSLAVE); - return -2; + return EC_SLAVECOUNTEXCEEDED; } } return wkc; diff --git a/soem/ethercattype.h b/soem/ethercattype.h index ba5b774..9dc2f84 100644 --- a/soem/ethercattype.h +++ b/soem/ethercattype.h @@ -37,12 +37,14 @@ extern "C" # define EC_LITTLE_ENDIAN #endif -/** return value general error */ -#define EC_ERROR -3 /** return value no frame returned */ -#define EC_NOFRAME -1 +#define EC_NOFRAME -1 /** return value unknown frame received */ -#define EC_OTHERFRAME -2 +#define EC_OTHERFRAME -2 +/** return value general error */ +#define EC_ERROR -3 +/** return value too many slaves */ +#define EC_SLAVECOUNTEXCEEDED -4 /** maximum EtherCAT frame length in bytes */ #define EC_MAXECATFRAME 1518 /** maximum EtherCAT LRW frame length in bytes */