Quote:
|
Originally Posted by Daniel
In the following code (with lots of test lines) the Move () function is called many time to determine if the move has completed. The printf which the first line of the function appears and so does the second showing "TT=%d". But the subsequent printf statments never appear and it acts like the function just simply returns to the caller.
I'm suspecting a problem with how C18 handles long math. Read the relese note... it can make a person worry about what works.
I've already logged one bug with Microchip. The SetChanADC function needs to shift the channel number one bit to the right. I'm working on another white paper about "Faster Analog" input. Anyone want to review it?
I have talked to other teams and many have seen this problem - but no one has indetified the "root cause". I'm officially told to re-enter my program. There has to be an answer to help all of us.
...
|
%d is designed to print out an
int, not a long. chances are that is the source of your problem. also, you might try the following to correct the "1200/2 = 22" bug:
instead of the current t = t / 2; line.
this is because 2 is automatically type cast to an unsigned char, and thus the math is performed in the unsigned char space, not the long space.