rtlabs-com / c-open

CANopen stack for embedded devices
http://www.rt-labs.com
Other
79 stars 40 forks source link

Only trigger the Error behaviour on the mandatory events #44

Closed nattgris closed 3 years ago

nattgris commented 3 years ago

The automatic NMT transition to Pre-operational, or any other action that has been configured in 1029h, is only required to happen on Bus- off or Life guarding/Heartbeat time-out. Currently, all EMCYs that are sent do trigger the error behaviour, even if the error is not a "serious CANopen device failure". It even reverts back to pre-operational when an error is cleared and EMCY 0x0000 is sent.

Turn off the error behaviour except for EMCY codes 0x8130 and 0x8140 which correspond to the mandatory events (although the Bus-off EMCY actually means recovery from Bus-off, so the Error behavior will happen much later than was probably intended).

Ref: #39

hefloryd commented 3 years ago

Merged, thanks!