You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/21 15:15:43 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7385: stm32/socketcan: fix the EFF flag for received frames

pkarashchenko commented on code in PR #7385:
URL: https://github.com/apache/incubator-nuttx/pull/7385#discussion_r1001910947


##########
arch/arm/src/stm32/stm32_can_sock.c:
##########
@@ -1207,12 +1207,12 @@ static int stm32can_rxinterrupt_work(struct stm32_can_s *priv, int rxmb)
   if ((regval & CAN_RIR_IDE) != 0)
     {
       frame->can_id  = (regval & CAN_RIR_EXID_MASK) >> CAN_RIR_EXID_SHIFT;
-      frame->can_id &= ~CAN_EFF_FLAG;
+      frame->can_id |= CAN_EFF_FLAG;
     }
   else
     {
       frame->can_id  = (regval & CAN_RIR_STID_MASK) >> CAN_RIR_STID_SHIFT;
-      frame->can_id |= CAN_EFF_FLAG;
+      frame->can_id &= ~CAN_EFF_FLAG;

Review Comment:
   Do we really need this line?



##########
arch/arm/src/stm32f7/stm32_can_sock.c:
##########
@@ -1231,12 +1231,12 @@ static int stm32can_rxinterrupt_work(struct stm32_can_s *priv, int rxmb)
   if ((regval & CAN_RIR_IDE) != 0)
     {
       frame->can_id  = (regval & CAN_RIR_EXID_MASK) >> CAN_RIR_EXID_SHIFT;
-      frame->can_id &= ~CAN_EFF_FLAG;
+      frame->can_id |= CAN_EFF_FLAG;
     }
   else
     {
       frame->can_id  = (regval & CAN_RIR_STID_MASK) >> CAN_RIR_STID_SHIFT;
-      frame->can_id |= CAN_EFF_FLAG;
+      frame->can_id &= ~CAN_EFF_FLAG;

Review Comment:
   Ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org