MITMotorsports / CANlib

An automatically generated C library for packing and unpacking based on ParseCAN specifications.
Apache License 2.0
5 stars 3 forks source link

CAN Write function overloading #4

Open nistath opened 6 years ago

nistath commented 6 years ago

Overload all CAN write functions so that one can do things like:

can0_MSGNM_T msg;
// populate msg here
write_can0(msg);
nistath commented 6 years ago

Change should happen about here.

This macro gets called with things like can0_MSGNM as name, hence why you currently would need to use can0_MSGNM_Write(msg) to write the message.

nistath commented 6 years ago

August Trollbäck [02:20] how would that work in C?

Nick Stathas [02:33] get dennis ritchie to git gud this is for c++ version of canlib pretty much keep this macro and implement the c++ version under an #if that identifies if we're in C++

nistath commented 6 years ago

__cplusplus info here.

Maybe move the DEFINE macro to the header file.