From: Pavel Pisa Date: Fri, 1 Dec 2017 16:40:26 +0000 (+0100) Subject: sfunction_canreceive: ensure correct handling for CAN_MESSAGE_TYPE and EFF frames. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/socketcan-simulink.git/commitdiff_plain/6042ab483acc59be26df66f45025239a5dbd38e9 sfunction_canreceive: ensure correct handling for CAN_MESSAGE_TYPE and EFF frames. Signed-off-by: Pavel Pisa --- diff --git a/blocks/tlc_c/sfunction_canreceive.tlc b/blocks/tlc_c/sfunction_canreceive.tlc index 5dbf4d2..eb67561 100644 --- a/blocks/tlc_c/sfunction_canreceive.tlc +++ b/blocks/tlc_c/sfunction_canreceive.tlc @@ -142,8 +142,10 @@ dlc = 8; %if %==4 // CAN_MESSAGE + memset(&%, 0, sizeof(%)); %.Length = dlc; %.ID = sc_frame.can_id & CAN_EFF_MASK; + %.Extended = sc_frame.can_id & CAN_EFF_FLAG? 1: 0; int i; for (i = 0; i < dlc; i++ ) { %.Data[i] = sc_frame.data[i];