Could someone please try this and post the result… for my sanity…
#class auto
#memmap xmem
void main(void)
{
long start_time;
long diff;
start_time=SEC_TIMER;
while (1)
{
costate
{
waitfor(DelaySec(1));
diff = (long)(SEC_TIMER-start_time);
printf("SEC_TIMER=%u start_time=%u
",SEC_TIMER, start_time);
printf("start_time=%u
", start_time);
printf("diff=%ld inline=%ld
", diff, (long)(SEC_TIMER-start_time));
}
}
}
I get this output…
SEC_TIMER=21321 start_time=18
start_time=21320
diff=1 inline=1
SEC_TIMER=21322 start_time=18
start_time=21320
diff=2 inline=2
SEC_TIMER=21323 start_time=18
start_time=21320
diff=3 inline=3
SEC_TIMER=21324 start_time=18
start_time=21320
diff=4 inline=4
SO…
On the first printf line, the start_time is not working, but it is fine on the second printf on its own… WTF??? Is this a possible compiler problem??
I am using DC10.66 with a RCM5400W if it makes any difference…
Dave