Other Parts Discussed in Thread: SYSBIOS
Hi There
I have come across an issue i'm not sure what to do with. I am using SysBios (bios_6_33_01_25). My code is simple it consists of a decrementing Uint32 delay count
to toggle an LED on an off. See Below. In debug mode I can set the delay value to 2^32 -1 and it works fine. When I change into release mode the ledDelay variable seems to behave like an Int32 and not UInt32. When I set its value greater than 2^31 the while(delay) loop is skipped and the LED is toggled on and off as no delay is present. When I set the delay value less than 2^31 the delay loop runs as expected.
Why is the declared Uint32 delay variable behaving like an Int32 variable in release mode only?
Any ideas whats going on here?
Regards
Tony
<code>
void testFcnToggleLedTask()
{
UInt32 ledDelay;
UInt32 delete;
while(1)
{
ledDelay = 2147483647;
while(ledDelay--);
delete=ledDelay;
drvrGpioSetOutPin(GPIO_BANK_2, PIN12, HIGH);
ledDelay = 2147483647;
while(ledDelay--);
delete=ledDelay;
drvrGpioSetOutPin(GPIO_BANK_2, PIN12, LOW);
}
}
</code>