Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 2 months ago.
mbed CAN Bus driver conflicts with MSCFile System
I am trying to compile using mbed's online compiler. I can compile the following code WITHOUT MSCFileSystem (which is needed to record data to a flash drive). BUT, when I add MSCFileSystem Library, the following code does not work. (MSCFileSystem Reference : https://developer.mbed.org/users/chris/code/app-board-MSCFileSystem/)
The only two errors the compiler gives is regarding "attach" function. The errors are : 1) Error: Class "mbed::CAN" has no member "RxIrq" in "main.cpp" 2) Error: No instance of overloaded function "mbed::CAN::attach" matches the argument list in "main.cpp"
I was able to get rid of the Error (1) by inputting "0" instead of "CAN::RxIrq." The second argument, I cannot get rid of. I tried other attach() function format as described in https://developer.mbed.org/handbook/CAN However, I am what input I should input for other attach functions. For example, for sharedpointer T*, I tried "(void)" and for pointer to the callback() function that I have made, I input &callback, and input 0 instead of CAN::RxIrq. Still.. didn't work.
Please help.
--------------CODE---------------
CAN can(p30, p29);
void callback(){
CANMessage msg;
can.read(msg);
}
int main() {
can.frequency(1000000);
can.attach(&callback, CAN::RxIrq);
while(1) { led1 = !led1; wait(1); } }