Page 1 of 1

CAN-bus bug or intended?

Posted: Tue Oct 19, 2010 9:18 am
by D.Bouchier
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

Re: CAN-bus bug or intended?

Posted: Tue Oct 19, 2010 10:45 am
by Benj
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.

Re: CAN-bus bug or intended?

Posted: Tue Oct 19, 2010 11:19 am
by D.Bouchier
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...