rtlabs-com / c-open

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

Dead code in co_handle_rx #19

Closed lrsdnlssn closed 4 years ago

lrsdnlssn commented 4 years ago

In co_handle_rx will different functions be called, depending on the received function code.

However, the function co_emcy_rx will never be called since the value CO_FUNCTION_EMCY is the same as the value CO_FUNCTION_SYNC, which already has been checked.

The correct condition to call co_pdo_sync should be:

else if ((function == CO_FUNCTION_SYNC) && (node == 0))