Skip to content

Commit eb6887b

Browse files
authored
Move the four-argument sendMsgBuf wrapper to mcp_can.h (#136)
1 parent b946ae7 commit eb6887b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/mcp2515_can.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ class mcp2515_can : public MCP_CAN
9292
virtual byte trySendMsgBuf(unsigned long id, byte ext, byte rtrBit, byte len, const byte *buf, byte iTxBuf = 0xff); // as sendMsgBuf, but does not have any wait for free buffer
9393
virtual byte sendMsgBuf(byte status, unsigned long id, byte ext, byte rtrBit, byte len, volatile const byte *buf); // send message buf by using parsed buffer status
9494
virtual byte sendMsgBuf(unsigned long id, byte ext, byte rtrBit, byte len, const byte *buf, bool wait_sent = true); // send buf
95-
/* wrapper */
96-
inline byte sendMsgBuf(unsigned long id, byte ext, byte len, const byte *buf) {
97-
return sendMsgBuf(id, ext, 0, len, buf, true);
98-
}
95+
9996

10097
virtual void clearBufferTransmitIfFlags(byte flags = 0); // Clear transmit flags according to status
10198
virtual byte readRxTxStatus(void); // read has something send or received

src/mcp2518fd_can.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ class mcp2518fd : public MCP_CAN {
154154
byte dlc, volatile const byte *buf);
155155
virtual byte sendMsgBuf(unsigned long id, byte ext, byte rtr, byte dlc,
156156
const byte *buf, bool wait_sent = true);
157-
/* wrapper */
158-
inline byte sendMsgBuf(unsigned long id, byte ext, byte len, const byte *buf) {
159-
return sendMsgBuf(id, ext, 0, len, buf, true);
160-
}
157+
161158

162159
virtual void clearBufferTransmitIfFlags(byte flags = 0);
163160
virtual byte readRxTxStatus(void);

src/mcp_can.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ class MCP_CAN
9494
byte len, volatile const byte *buf) = 0; // send message buf by using parsed buffer status
9595
virtual byte sendMsgBuf(unsigned long id, byte ext, byte rtrBit,
9696
byte len, const byte *buf, bool wait_sent = true) = 0; // send message with wait
97-
97+
/* wrapper */
98+
inline byte sendMsgBuf(unsigned long id, byte ext, byte len, const byte *buf) {
99+
return sendMsgBuf(id, ext, 0, len, buf, true);
100+
}
101+
98102
virtual void clearBufferTransmitIfFlags(byte flags = 0) = 0; // Clear transmit flags according to status
99103
virtual byte readRxTxStatus(void) = 0; // read has something send or received
100104
virtual byte checkClearRxStatus(byte *status) = 0; // read and clear and return first found rx status bit

0 commit comments

Comments
 (0)