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
CAN-bus bug or intended?
-
- Posts: 28
- Joined: Tue Sep 28, 2010 12:36 pm
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: CAN-bus bug or intended?
Hello,
I have not come across this problem. Seems very odd to me. Maybe you could post up a simple example that demonstrates this problem.
I have not come across this problem. Seems very odd to me. Maybe you could post up a simple example that demonstrates this problem.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 28
- Joined: Tue Sep 28, 2010 12:36 pm
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Re: CAN-bus bug or intended?
Ok, I cannot seem to reproduce this, then probably something else was the problem, something I fixed earlier.
Sorry for the inconvenience.
ps. just delete this thread then...
Sorry for the inconvenience.
ps. just delete this thread then...