GCC Structure Wacko

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

So why won't this code compile. Fails on the assign to COM.State

   

 

   

#define BUFSIZE 10

volatile typedef struct {

  char   Buf[BUFSIZE];
  uint8  DataBytes;
  uint32 Timer;
  uint8  DatainBuf;
  uint8  State;
  uint8  Timeout;

} comtype;

volatile typedef struct comtype COM;
volatile typedef struct comtype SMS;

int main()
{
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
    for(;;)
    {
       
        COM.State = 1;
       
    }
}

   

 

   

Ugh, Dana.

0 Likes
3 Replies