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.

Initializing struct

Hello,

I am using CCS 5.4 and I have the following struct:

struct spi_data {
   unsigned int baud_rate;
   unsigned int nbits;
   unsigned int chip_select
}

And I am creating an instance of this struct like this:

static struct spi_data config = 
{
   .baud_rate   = 1,
   .nbits       = 8,
   .chip_select = 1
}

This gives me a compilation error: #29 expected an expression. I don't think I'm doing anythiong wrong here, bute when I change it to the following way it works ok:

static struct spi_data config = 
{
   1,
   8,
   1
}

CCS doesn't support this way of initializing structs? Could it be that I'm doing something wrong and I don't see it?