This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with case statement

I am executing the following code part (KEIL development environment, Microcontroller ADuC7020).
if I do insert the "case: 1" structure in func1(), the debugger does not start. If I delete the "case: 1" structure in func1() the code does execute. What is the problem ("....." means that there are other code parts on this place)

regards Samuel

main()
{ .......
var1 = 1;
.......
func1();
.......
}

func1()
{ switch(var1)
.............
case 1:
.............
break;
......
}

Parents Reply Children
  • He probably recommends that you post a bit more of the code, since the existing code shows too little information for us to have any idea.

    Note that some processors may fail to boot in case they have too much initialized data, and have the watchdog activated before you reach main().

    Some processors may fail because of stack space availability while uncompressing initialized data.

    Use of functions that requires heap may also make the program fail before reaching main().

    What have you done to figure out how fast you lose the processor?