Merge pull request #601 from rhdlilj/master
Using context->maxslave instead EC_MAXSLAVE
This commit is contained in:
commit
703a6e08d6
|
@ -134,14 +134,14 @@ int ecx_detect_slaves(ecx_contextt *context)
|
||||||
if (wkc > 0)
|
if (wkc > 0)
|
||||||
{
|
{
|
||||||
/* this is strictly "less than" since the master is "slave 0" */
|
/* this is strictly "less than" since the master is "slave 0" */
|
||||||
if (wkc < EC_MAXSLAVE)
|
if (wkc < context->maxslave)
|
||||||
{
|
{
|
||||||
*(context->slavecount) = wkc;
|
*(context->slavecount) = wkc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EC_PRINT("Error: too many slaves on network: num_slaves=%d, EC_MAXSLAVE=%d\n",
|
EC_PRINT("Error: too many slaves on network: num_slaves=%d, max_slaves=%d\n",
|
||||||
wkc, EC_MAXSLAVE);
|
wkc, context->maxslave);
|
||||||
return EC_SLAVECOUNTEXCEEDED;
|
return EC_SLAVECOUNTEXCEEDED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue