From c879aabd02342d1f2881524adffb748e0596b378 Mon Sep 17 00:00:00 2001 From: lilj <55023294+rhdlilj@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:25:06 +0800 Subject: [PATCH] Update ethercatconfig.c Using context->maxslave instead EC_MAXSLAVE --- soem/ethercatconfig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soem/ethercatconfig.c b/soem/ethercatconfig.c index c004982..47c5c94 100644 --- a/soem/ethercatconfig.c +++ b/soem/ethercatconfig.c @@ -134,14 +134,14 @@ int ecx_detect_slaves(ecx_contextt *context) if (wkc > 0) { /* this is strictly "less than" since the master is "slave 0" */ - if (wkc < EC_MAXSLAVE) + if (wkc < context->maxslave) { *(context->slavecount) = wkc; } else { - EC_PRINT("Error: too many slaves on network: num_slaves=%d, EC_MAXSLAVE=%d\n", - wkc, EC_MAXSLAVE); + EC_PRINT("Error: too many slaves on network: num_slaves=%d, max_slaves=%d\n", + wkc, context->maxslave); return EC_SLAVECOUNTEXCEEDED; } }