Skip to content

Commit 7dbf333

Browse files
committed
Check success status after sending message
1 parent be8ad40 commit 7dbf333

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mcp2515.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,10 @@ MCP2515::ERROR MCP2515::sendMessage(const TXBn txbn, const struct can_frame *fra
591591

592592
modifyRegister(txbuf->CTRL, TXB_TXREQ, TXB_TXREQ);
593593

594+
uint8_t ctrl = readRegister(txbuf->CTRL);
595+
if ((ctrl & (TXB_ABTF | TXB_MLOA | TXB_TXERR)) != 0) {
596+
return ERROR_FAILTX;
597+
}
594598
return ERROR_OK;
595599
}
596600

0 commit comments

Comments
 (0)