I want to create an array of array of struct. Where is the error here? Practically I have 2 leds with 4 states (patterns) with 3 parameters (a,b,c). Thank you in advance.
typedef struct {
int a;
int b;
int c;
}CfgType;
CfgType Led[4][2];
Led[4][0]=
{
/* Pattern a b c */
/*00*/ /*STATE0*/ { 5 , 100 , 2 },
/*01*/ /*STATE1*/ { 5 , 100 , 1 },
/*02*/ /*STATE2*/ { 100 , 100 , 0 },
/*03*/ /*STATE3*/ { 100 , 100 , 0 },
};
Led[4][1]=
{
/* Pattern a b c */
/*00*/ /*STATE0*/ { 5 , 100 , 2 },
/*01*/ /*STATE1*/ { 5 , 100 , 1 },
/*02*/ /*STATE2*/ { 100 , 100 , 0 },
/*03*/ /*STATE3*/ { 100 , 100 , 0 },
};
Led[4]is offset 4 and this is outside the array.