Мне нужно сделать таблицы описания переменных, которые должны располагаться во Flash. Таблицы разной длины.
Делаю так.
#ifndef _NETVAR_DEF_
typedef struct stVarDes
{ unsigned char *addr;
unsigned size;
unsigned type;
} stVarDes;
typedef struct stVarTbl
{ unsigned num;
stVarDes varDes[];
} stVarTbl;
#define _NETVAR_DEF_
#endifconst stVarTbl varTbl1=
{ 3,
{ (unsigned char *)&pGD->pass, sizeof(pGD->pass), 0}, //<-ошибка в строке
{ (unsigned char *)&pGD->status, sizeof(pGD->status), 0}, //<-ошибка в строке
{ (unsigned char *)&pGD->exps, sizeof(pGD->exps), 0} //<-ошибка в строке
};
Указатель pGD глобальный на глобальную структуру данных и он определен. Переменные из этой структуры pass, status, exps типа float. Мне нужно описать в таблице указатель на эти переменные для байтового доступа к ним. В каждой таблице разное количество описываемых переменных.
ИАР выдает ошибки
Error[Pe146]: too many initializer values ...\netVar.c 19
Error[Pe028]: expression must have a constant value ...\netVar.c 19
Error[Pe041]: expression must have arithmetic or pointer type ...\netVar.c 19
Error[Pe028]: expression must have a constant value ...\netVar.c 20
Error[Pe041]: expression must have arithmetic or pointer type ...\netVar.c 20
Error[Pe028]: expression must have a constant value ...\netVar.c 21
Error[Pe041]: expression must have arithmetic or pointer type ...\netVar.c 21
Что я не так делаю? И как сделать правильно?