From 8dc104ef87dcc24999226059bebc1d48a9bc2e48 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Thu, 3 Dec 2020 10:47:44 +0100 Subject: [PATCH] Don't send EMCY for broadcast MPDO failures Signed-off-by: Andreas Fritiofson Change-Id: I81a392f96c3db6fc0e3ffe70460f80de9ef3cb01 --- src/co_pdo.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/co_pdo.c b/src/co_pdo.c index c6e4ef1..4083c14 100644 --- a/src/co_pdo.c +++ b/src/co_pdo.c @@ -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)