Skip to content

Commit

Permalink
Don't send EMCY for broadcast MPDO failures
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Fritiofson <[email protected]>
Change-Id: I81a392f96c3db6fc0e3ffe70460f80de9ef3cb01
  • Loading branch information
Andreas Fritiofson committed Sep 10, 2021
1 parent 6380a3b commit 8dc104e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/co_pdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,26 @@ static int co_mpdo_unpack (co_net_t * net, co_pdo_t * pdo)

obj = co_obj_find (net, index);
if (obj == NULL)
return co_emcy_tx (net, 0x8230, 0, NULL);
goto error;

entry = co_entry_find (net, obj, subindex);
if (entry == NULL || !(entry->flags & OD_WRITE))
return co_emcy_tx (net, 0x8230, 0, NULL);
goto error;

if (co_od_set_value (net, obj, entry, subindex, value))
return co_emcy_tx (net, 0x8230, 0, NULL);
goto error;

} else {
/* TODO: Support SAM-MPDO Consumer using dispatcher list. */
}

return 0;

error:
if (node != 0)
return co_emcy_tx (net, 0x8230, 0, NULL);

return 0;
}

void co_pdo_unpack (co_net_t * net, co_pdo_t * pdo)
Expand Down

0 comments on commit 8dc104e

Please sign in to comment.