Skip to content

Commit 8dc104e

Browse files
committed
Don't send EMCY for broadcast MPDO failures
Signed-off-by: Andreas Fritiofson <[email protected]> Change-Id: I81a392f96c3db6fc0e3ffe70460f80de9ef3cb01
1 parent 6380a3b commit 8dc104e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/co_pdo.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,26 @@ static int co_mpdo_unpack (co_net_t * net, co_pdo_t * pdo)
112112

113113
obj = co_obj_find (net, index);
114114
if (obj == NULL)
115-
return co_emcy_tx (net, 0x8230, 0, NULL);
115+
goto error;
116116

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

121121
if (co_od_set_value (net, obj, entry, subindex, value))
122-
return co_emcy_tx (net, 0x8230, 0, NULL);
122+
goto error;
123123

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

128128
return 0;
129+
130+
error:
131+
if (node != 0)
132+
return co_emcy_tx (net, 0x8230, 0, NULL);
133+
134+
return 0;
129135
}
130136

131137
void co_pdo_unpack (co_net_t * net, co_pdo_t * pdo)

0 commit comments

Comments
 (0)