Part Number: EK-TM4C1294XL
Tool/software: TI C/C++ Compiler
Hello.
Compiler 18.12.3.LTS, 18.12.2.LTS debug single step into (F5) over (F6) ignores case integer value 0, jumps into case 1. This occurs to switch case existing inside Systick handler function 20ms timer looping with static variables shown below.
Any idea why it happens only in Systick timer and acts as if the stack is not being properly managed? Also the default switch case occurs every single step pass via F6.
void
SysTickIntHandler(void)
{
static uint32_t TurnOffLED = 0;
static uint32_t TurnOnLED = 0;
static unsigned int NextCase = 0;
/* Engage a flip flop between LED D1 and D2 */
switch(NextCase)
{
case 0:
{
/* Turn on LED D2 and Trun off LED D1 */
if(TurnOnLED <= 65535)
{
MAP_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0);
MAP_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, ~GPIO_PIN_1);
TurnOnLED ++;
if(TurnOnLED >= 65535)
{
TurnOffLED = 0;
NextCase = 1;
break;
}
}
}
case 1:
{
/* Turn off LED D2 and Turn on LED D1 */
if(TurnOffLED <= 65535)
{
MAP_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, ~GPIO_PIN_0);
MAP_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1);
TurnOffLED++;
if(TurnOffLED >= 65535)
{
TurnOnLED = 0;
NextCase = 0;
break;
}
}
}
default:
{
//TurnOffLED = 0;
//TurnOnLED = 0;
//NextCase = 0;
break;
}
}
}