Skip to content

Commit

Permalink
Fix bug in ecx_readIDNmap(), Osize and Isize
Browse files Browse the repository at this point in the history
Osize and Isize where reset to 16 at every new drive number, thus loosing all lower drive mapping data. Changed to add 16 to Osize and Isize.
  • Loading branch information
ArthurKetels authored Oct 1, 2020
1 parent f69b1ab commit cbc8f36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions soem/ethercatsoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize)
if ((wkc > 0) && (psize >= 4) && ((entries = etohs(SoEmapping.currentlength) / 2) > 0) && (entries <= EC_SOE_MAXMAPPING))
{
/* command word (uint16) is always mapped but not in list */
*Osize = 16;
*Osize += 16;
for (itemcount = 0 ; itemcount < entries ; itemcount++)
{
psize = sizeof(SoEattribute);
Expand All @@ -348,7 +348,7 @@ int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize)
if ((wkc > 0) && (psize >= 4) && ((entries = etohs(SoEmapping.currentlength) / 2) > 0) && (entries <= EC_SOE_MAXMAPPING))
{
/* status word (uint16) is always mapped but not in list */
*Isize = 16;
*Isize += 16;
for (itemcount = 0 ; itemcount < entries ; itemcount++)
{
psize = sizeof(SoEattribute);
Expand Down

0 comments on commit cbc8f36

Please sign in to comment.