Lowest state should not contain error flag

This commit is contained in:
Mikael Heden 2015-12-18 14:53:16 +01:00
parent eac0acd809
commit d5fa11630d
1 changed files with 2 additions and 2 deletions

View File

@ -784,9 +784,9 @@ int ecx_readstate(ecx_contextt *context)
configadr = context->slavelist[slave].configadr;
rval = etohs(sl[slave - fslave].alstatus);
context->slavelist[slave].ALstatuscode = etohs(sl[slave - fslave].alstatuscode);
if (rval < lowest)
if ((rval & 0xf) < lowest)
{
lowest = rval;
lowest = (rval & 0xf);
}
context->slavelist[slave].state = rval;
context->slavelist[0].ALstatuscode |= context->slavelist[slave].ALstatuscode;