Quote:
|
Originally Posted by roknjohn
Here is the ouput using the EDU controller: (I only output a line every 5th program loop) I marked lines that contain errors with asteriks.
Code:
GetTime() = 16017d1 tmsClock = 352
GetTime() = 16d104a tmsClock = 365
GetTime() = 17a8cf tmsClock = 378 *****
GetTime() = 187181 tmsClock = 391 *****
It looks like the last hex digit is being dropped every so often.
|
Actually it's not the last one... the output you should be getting is
GetTime() = 016017d1 tmsClock = 352
GetTime() = 016d104a tmsClock = 365
GetTime() = 017a08cf tmsClock = 378 *****
GetTime() = 01870181 tmsClock = 391 *****
Notice the extra 0's. The problem is the printf function doesn't zero pad the output like it should. That is 'ok' for the ints, but for the longs it causes problems (In the printf lib, the printi function actually gets called twice for longs. once for each word.)