Using Enumerations problem?

Hi,

I'm using the MCBSTM32E board with STM32F103ZE uC.

If I declare an enumeration type as 'static' in a function or as a global variable then the compiler signals no error or warning but the application simply does not run.

typedef enum{
first=1,
second=2
}TeMyEnum;

void vMyFunc(){
 static TeMyEnum eMyEnum=second;
}

Where do I go wrong?

Thanks
Henk

Parents
  • What do you mean by, "simply does not run."

    The only thing that would stop the program running is if the processor is not running.

    Almost certainly, the program is running - just not as you expected.
    Quite possibly, it is crashing.

    What Debugging have you done to find out exactly what is really happening?

    Are you running in the Simulator, or real hardware?

Reply
  • What do you mean by, "simply does not run."

    The only thing that would stop the program running is if the processor is not running.

    Almost certainly, the program is running - just not as you expected.
    Quite possibly, it is crashing.

    What Debugging have you done to find out exactly what is really happening?

    Are you running in the Simulator, or real hardware?

Children
More questions in this forum