]> git.feebdaed.xyz Git - 0xmirror/SOEM.git/commitdiff
Update ethercatconfig.c
authorlilj <55023294+rhdlilj@users.noreply.github.com>
Wed, 16 Mar 2022 09:25:06 +0000 (17:25 +0800)
committerGitHub <noreply@github.com>
Wed, 16 Mar 2022 09:25:06 +0000 (17:25 +0800)
Using context->maxslave instead EC_MAXSLAVE

soem/ethercatconfig.c

index c0049827a97087bf3d6293f532033fa9f18de560..47c5c945b16abd3ee56e17ac21da94ceab60c6a7 100644 (file)
@@ -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;
       }
    }