stm32: use TME bits to find the canbus tx mailbox
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
3c7eea7336
commit
39535b15ba
|
@ -135,7 +135,11 @@ canbus_send(uint32_t id, uint32_t len, uint8_t *data)
|
||||||
irq_enable();
|
irq_enable();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int mbox = (tsr & CAN_TSR_CODE) >> CAN_TSR_CODE_Pos;
|
int mbox = 2;
|
||||||
|
if (tsr & CAN_TSR_TME0)
|
||||||
|
mbox = 0;
|
||||||
|
else if (tsr & CAN_TSR_TME1)
|
||||||
|
mbox = 1;
|
||||||
CAN_TxMailBox_TypeDef *mb = &SOC_CAN->sTxMailBox[mbox];
|
CAN_TxMailBox_TypeDef *mb = &SOC_CAN->sTxMailBox[mbox];
|
||||||
|
|
||||||
/* Set up the DLC */
|
/* Set up the DLC */
|
||||||
|
|
Loading…
Reference in New Issue