Skip to content

Commit

Permalink
Merge pull request OpenEtherCATsociety#39 from Cloud-Automation/master
Browse files Browse the repository at this point in the history
Fixed grouping problem.
Intermediate solution
  • Loading branch information
ArthurKetels committed May 26, 2016
2 parents 4bb4b59 + 9cc335e commit 43e4493
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions soem/ethercatmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,18 @@ static int ecx_pullindex(ecx_contextt *context)
return rval;
}

/**
* Clear the idx stack.
*
* @param context = context struct
*/
static void ecx_clearindex(ecx_contextt *context) {

context->idxstack->pushed = 0;
context->idxstack->pulled = 0;

}

/** Transmit processdata to slaves.
* Uses LRW, or LRD/LWR if LRW is not allowed (blockLRW).
* Both the input and output processdata are transmitted.
Expand Down Expand Up @@ -1655,11 +1667,7 @@ int ecx_send_processdata_group(ecx_contextt *context, uint8 group)
LogAdr = context->grouplist[group].logstartaddr;
if (length)
{
if(!group)
{
context->idxstack->pushed = 0;
context->idxstack->pulled = 0;
}

wkc = 1;
/* LRW blocked by one or more slaves ? */
if (context->grouplist[group].blockLRW)
Expand Down Expand Up @@ -1863,6 +1871,8 @@ int ecx_receive_processdata_group(ecx_contextt *context, uint8 group, int timeou
pos = ecx_pullindex(context);
}

ecx_clearindex(context);

/* if no frames has arrived */
if (valid_wkc == 0)
{
Expand Down

0 comments on commit 43e4493

Please sign in to comment.