Update ethercatconfig.c

Using context->maxslave instead EC_MAXSLAVE
This commit is contained in:
lilj 2022-03-16 17:25:06 +08:00 committed by GitHub
parent 9b6ebd6e43
commit c879aabd02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View 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;
}
}