STM32 CAN correction suggested by Max Holtzberg

This commit is contained in:
Gregory Nutt 2014-09-24 08:23:05 -06:00
parent dcdfd99a08
commit 31329acede

View File

@ -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 */ /* Select one empty transmit mailbox */
regval = can_getreg(priv, STM32_CAN_TSR_OFFSET); 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; txmb = 0;
} }
else if ((regval & CAN_TSR_TME1) != 0) else if ((regval & CAN_TSR_TME1) != 0 && (regval & CAN_TSR_RQCP1) == 0)
{ {
txmb = 1; txmb = 1;
} }
else if ((regval & CAN_TSR_TME2) != 0) else if ((regval & CAN_TSR_TME2) != 0 && (regval & CAN_TSR_RQCP2) == 0)
{ {
txmb = 2; txmb = 2;
} }