We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 23b23ef + c8556d5 commit ad48756Copy full SHA for ad48756
src/mcp2515_can.cpp
@@ -1038,7 +1038,7 @@ byte mcp2515_can::mcp2515_getNextFreeTXBuf(byte* txbuf_n) { // get
1038
}
1039
1040
// check all 3 TX-Buffers except reserved
1041
- for (i = 0; i < MCP_N_TXBUFFERS - nReservedTx; i++) {
+ for (i = MCP_N_TXBUFFERS - nReservedTx; i >= 0; i--) {
1042
if ((status & txStatusPendingFlag(i)) == 0) {
1043
*txbuf_n = txCtrlReg(i) + 1; // return SIDH-address of Buffer
1044
mcp2515_modifyRegister(MCP_CANINTF, txIfFlag(i), 0);
0 commit comments