From 31329acedeebb6b038380368fde99eeb70201204 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 24 Sep 2014 08:23:05 -0600 Subject: [PATCH] STM32 CAN correction suggested by Max Holtzberg --- arch/arm/src/stm32/stm32_can.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index ddedce82e7..6c11375792 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -820,15 +820,15 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) /* Select one empty transmit mailbox */ regval = can_getreg(priv, STM32_CAN_TSR_OFFSET); - if ((regval & CAN_TSR_TME0) != 0) + if ((regval & CAN_TSR_TME0) != 0 && (regval & CAN_TSR_RQCP0) == 0) { txmb = 0; } - else if ((regval & CAN_TSR_TME1) != 0) + else if ((regval & CAN_TSR_TME1) != 0 && (regval & CAN_TSR_RQCP1) == 0) { txmb = 1; } - else if ((regval & CAN_TSR_TME2) != 0) + else if ((regval & CAN_TSR_TME2) != 0 && (regval & CAN_TSR_RQCP2) == 0) { txmb = 2; }