Skip to content

Commit

Permalink
Update ethercatconfig.c
Browse files Browse the repository at this point in the history
Using context->maxslave instead EC_MAXSLAVE
  • Loading branch information
rhdlilj authored Mar 16, 2022
1 parent 9b6ebd6 commit c879aab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions soem/ethercatconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c879aab

Please sign in to comment.