CAN-bus bug or intended?
Posted: Tue Oct 19, 2010 9:18 am
Hello,
I was testing a little bit with the CAN-bus on the MIAC and discovered that if you reset the variable that is used as return value for CheckRx at the start of your programm (after CANinit, before the main loop) that the interface does not work.
I have the urge to define all variables in start-up to prevent any unwanted values, so I learned this the hard way
But it does work if you reset the variable to 0 before the CANinit macro, therefore I think the variable is used in the CANinit and needs this to work when it's being written by CheckRx.
This is a little awkward if you're used to C-programming because it's not a visible return value for the CANinit macro and not a visible parameter for CheckRx.
So yea, I solved it myself, but just a heads-up for anyone else who's interested.
Greetings
I was testing a little bit with the CAN-bus on the MIAC and discovered that if you reset the variable that is used as return value for CheckRx at the start of your programm (after CANinit, before the main loop) that the interface does not work.
I have the urge to define all variables in start-up to prevent any unwanted values, so I learned this the hard way
But it does work if you reset the variable to 0 before the CANinit macro, therefore I think the variable is used in the CANinit and needs this to work when it's being written by CheckRx.
This is a little awkward if you're used to C-programming because it's not a visible return value for the CANinit macro and not a visible parameter for CheckRx.
So yea, I solved it myself, but just a heads-up for anyone else who's interested.
Greetings