I have a structure like this
typedef enum {
STATE_PAUSED = 0,
STATE_RUN,
STATE_COUNTING,
STATE_PERIODIC,
} State_t;
And what I need is to extend for new states that make sens just locally. Basically I want to have a switch that handles both original me->State and extended one State.
So I thought to wrap all in a local union but I can't figure out how :) Of course, I will take care for overlapping values.
typedef union{
State_t OrigState;
typedef enum {
GPS_MCU_UART_DEFAULT = 10,
}LocalState;
}State;
switch((State)(me->State))
{
case STATE_RUN:
break;
case GPS_MCU_UART_DEFAULT:
break;
}
Appreciate a little help.