This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

unexpected variable behavior

Hello,  I'm using CCS5 with TI compiler 7.3.4 on a C6478 LCDK board.

I'm writing the UART communication scheme, and I'm seeing some odd behavior.  I'm using an enum type to receive a uart command.

//enum declaration

enum rxstate_type {READY, START_BYTE_RECEIVED,LEN1_RECEIVED, LENGTH_RECEIVED};
enum rxstate_type rxstate = READY;

//in UART ISR

switch(rxstate)
{
       //waiting to RX start byte
       case READY:
       temp = UARTCharGetNonBlocking(SOC_UART_2_REGS);
       if(temp == STARTBYTE)
       {
              rxstate = START_BYTE_RECEIVED;
       }
       break;

       case START_BYTE_RECEIVED:

       rxArray[rx_count++] = UARTCharGetNonBlocking(SOC_UART_2_REGS);
       rxstate = LEN1_RECEIVED;

       break;

       case LEN1_RECEIVED:
       rxArray[rx_count++] = (UARTCharGetNonBlocking(SOC_UART_2_REGS));
       rx_len = rxArray[0] << 8;
       rx_len = rx_len + (rxArray[1]&0xFF);
       rxstate = LENGTH_RECEIVED;
       break;

     ///etc etc etc

My rxstate variable starts out as "READY"

When I received the startbyte, it successfully changes to "START_BYTE_RECEIVED".  However, in LEN1_RECEIVED case, the rxstate doesn't change to LEN1_RECEIVED.

I've set a breakpoint and stepped through the code, but rxstate doesn't change.  Any help with this would be appreciated.

Thanks