Skip to content

Commit

Permalink
ethercatconfig : Set SM enable flag if SM length > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKetels authored Jan 31, 2019
1 parent b4f3a30 commit 4427684
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions soem/ethercatconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,12 @@ static int ecx_map_sm(ecx_contextt *context, uint16 slave)
context->slavelist[slave].SM[nSM].SMflags =
htoel( etohl(context->slavelist[slave].SM[nSM].SMflags) & EC_SMENABLEMASK);
}
/* if SM length is non zero always set enable flag */
else
{
context->slavelist[slave].SM[nSM].SMflags =
htoel( etohl(context->slavelist[slave].SM[nSM].SMflags) | ~EC_SMENABLEMASK);
}
ecx_FPWR(context->port, configadr, (uint16)(ECT_REG_SM0 + (nSM * sizeof(ec_smt))),
sizeof(ec_smt), &context->slavelist[slave].SM[nSM], EC_TIMEOUTRET3);
EC_PRINT(" SM%d Type:%d StartAddr:%4.4x Flags:%8.8x\n", nSM,
Expand Down

0 comments on commit 4427684

Please sign in to comment.