-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples Do Not Compile #138
Comments
Seems like pull #136 deprecated the Solution |
It doesn't look like that was the intent of #136. It's probably worth looking at if that PR should have been handled different. It's causing me problems now as I update my version of the library. Edit: An additional workaround is to call the function as MCP_CAN::sendMsgBuf(arg1, arg2, arg3, arg4) |
Hello, I'm the one to blame for writing #136, and it probably should have been handled differently. I didn't mean to override or mask any existing four-argument I saw three CAN implementations in this library: The following code was in both impementations: /* wrapper */
inline byte sendMsgBuf(unsigned long id, byte ext, byte len, const byte *buf) {
return sendMsgBuf(id, ext, 0, len, buf, true);
} My goal for #136 was to isolate redundant code and make this four-parameter wrapper available to every implementation of #139 fixes all the examples by replacing every instance of I propose to make a new PR where every implementation includes For example: class mcp2518fd : public MCP_CAN {
public:
...
virtual byte trySendMsgBuf(unsigned long id, byte ext, byte rtr, byte dlc,
const byte *buf, byte iTxBuf = 0xff);
virtual byte sendMsgBuf(byte status, unsigned long id, byte ext, byte rtr,
byte dlc, volatile const byte *buf);
virtual byte sendMsgBuf(unsigned long id, byte ext, byte rtr, byte dlc,
const byte *buf, bool wait_sent = true);
using MCP_CAN::sendMsgBuf;
...
} Initial testing looks promising, but I'll wait a few days for comments/concerns here before submitting a PR in case there are any glaring issues I'm forgetting about. PRs in this repo tend to be accepted quickly without much internal testing. |
That's exactly what I would do. |
OK, patch available and requested in #146. Thoughts? |
The following examples do not compile:
send
send_Blink
send_receive
send_receiveFD
send_sleep
sendFD
Compiler Error:
no matching function for call to 'mcp2515_can::sendMsgBuf(int, int, int, unsigned char [8])'
Hardware:
Arduino Uno
Arduino Nano
Software:
Arduino IDE v1.8.19
Opinion:
This library seems to be the most commonly used on help forums and blogs and has healthy responses to issues and pull requests. It seems to be the best library for a new programmer to get started with. However, the basic usage examples do not compile out of the box making it extremely difficult on most Arduino users. The simpler examples do compile with an older version of the library. These examples need to be revised so that a basic sketch with only the bare minimal code compiles.
The text was updated successfully, but these errors were encountered: