This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 40690a99513 arch/sim/sim_canchar.c: fix CAN flags decoding for message
40690a99513 is described below

commit 40690a99513d4b58138a69fe2b98494617174a8e
Author: raiden00pl <[email protected]>
AuthorDate: Mon Sep 8 11:26:08 2025 +0200

    arch/sim/sim_canchar.c: fix CAN flags decoding for message
    
    fix CAN flags decoding for SIM CAN
    
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/sim/src/sim/sim_canchar.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/sim/src/sim/sim_canchar.c b/arch/sim/src/sim/sim_canchar.c
index 5a1843c9a95..ae7be7c7e1d 100644
--- a/arch/sim/src/sim/sim_canchar.c
+++ b/arch/sim/src/sim/sim_canchar.c
@@ -307,17 +307,17 @@ static void sim_can_work(void *arg)
 
       hdr.ch_id    = frame.can_id & CAN_ERR_MASK;
       hdr.ch_dlc   = can_bytes2dlc(frame.len);
-      hdr.ch_rtr   = frame.can_id & CAN_RTR_FLAG;
+      hdr.ch_rtr   = (bool)(frame.can_id & CAN_RTR_FLAG);
 #ifdef CONFIG_CAN_ERRORS
-      hdr.ch_error = frame.can_id & CAN_ERR_FLAG;
+      hdr.ch_error = (bool)(frame.can_id & CAN_ERR_FLAG);
 #endif
 #ifdef CONFIG_CAN_EXTID
-      hdr.ch_extid = frame.can_id & CAN_EFF_FLAG;
+      hdr.ch_extid = (bool)(frame.can_id & CAN_EFF_FLAG);
 #endif
 #ifdef CONFIG_CAN_FD
-      hdr.ch_edl   = frame.flags & CANFD_FDF;
-      hdr.ch_brs   = frame.flags & CANFD_BRS;
-      hdr.ch_esi   = frame.flags & CANFD_ESI;
+      hdr.ch_edl   = (bool)(frame.flags & CANFD_FDF);
+      hdr.ch_brs   = (bool)(frame.flags & CANFD_BRS);
+      hdr.ch_esi   = (bool)(frame.flags & CANFD_ESI);
 #endif
       hdr.ch_tcf   = 0;
 #ifdef CONFIG_CAN_TIMESTAMP

Reply via email to