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.

MSP430FR2355: trying to initialize an array that is within a struct?

Part Number: MSP430FR2355


I have the following within an h file:

typedef struct
{
    uint8_t Channels[10];      /*values @CHANNELS */
    uint32_t Rate;              /*sample rate */
    uint8_t CycleSeqence;       /*values @CYCLE */
    uint8_t TriggerSrc;         /*values @TRIGGER */
    uint8_t TriggerChannel;     /*values @CHANNELS */
    uint16_t TriggerLevelLow;
    uint16_t TriggerLevelHigh;
}ADC_Config_t;

Within main I am trying to do the following but cannot seem to get this to work

ADCTest.ADC_Config.Channels[] = {ADC_CH3, ADC_CH1, ADC_CH2};

Is there a way in a single line to initialize the array without using three separate lines, one for each element (which works by the way)?

I am using C99 compiler

Thanks

**Attention** This is a public forum