Skip to content

Commit

Permalink
Lowest state should not contain error flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Heden committed Feb 17, 2016
1 parent eac0acd commit d5fa116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions soem/ethercatmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d5fa116

Please sign in to comment.