arch/arm/stm32{|f7}/socketcan: fix debugassert for extid frames

fix debugassert for extid frames, we have to remove
CAN_EFF_FLAG bit from the expression
This commit is contained in:
raiden00pl 2024-10-07 11:49:12 +02:00 committed by Xiang Xiao
parent d186c1cedb
commit c1c5d8d611
3 changed files with 3 additions and 3 deletions

View File

@ -881,7 +881,7 @@ static int stm32can_transmit(struct stm32_can_s *priv)
regval &= ~CAN_TIR_EXID_MASK;
if (frame->can_id & CAN_EFF_FLAG)
{
DEBUGASSERT(frame->can_id < (1 << 29));
DEBUGASSERT((frame->can_id ^ CAN_EFF_FLAG) < (1 << 29));
regval |= (frame->can_id << CAN_TIR_EXID_SHIFT) | CAN_TIR_IDE;
}
else

View File

@ -1682,7 +1682,7 @@ static int fdcan_send(struct stm32_fdcan_s *priv)
#ifdef CONFIG_NET_CAN_EXTID
if ((frame->can_id & CAN_EFF_FLAG) != 0)
{
DEBUGASSERT(frame->can_id < (1 << 29));
DEBUGASSERT((frame->can_id ^ CAN_EFF_FLAG) < (1 << 29));
txbuffer[0] |= BUFFER_R0_EXTID(frame->can_id) | BUFFER_R0_XTD;
}

View File

@ -905,7 +905,7 @@ static int stm32can_transmit(struct stm32_can_s *priv)
regval &= ~CAN_TIR_EXID_MASK;
if (frame->can_id & CAN_EFF_FLAG)
{
DEBUGASSERT(frame->can_id < (1 << 29));
DEBUGASSERT((frame->can_id ^ CAN_EFF_FLAG) < (1 << 29));
regval |= (frame->can_id << CAN_TIR_EXID_SHIFT) | CAN_TIR_IDE;
}
else