util.h
Code:
typedef struct Pesos {
u32_t idxPonteiro;
u32_t Pesos[100];
u16_t iVazio;
} strPesos;
u8_t chksum8(u8_t *buff, u32_t tam);
u8_t hex2bin(u8_t dig);
void CriarPilha(strPesos * strPilha);
void InserePilha(strPesos strPilha, u32_t peso);
u32_t PegarPilha(strPesos strPilha);
u16_t PilhaVazia(strPesos strPilha);
void ZerarPilha(strPesos strPilha);
util.c
Code:
void CriarPilha(strPesos * strPilha)
{
//strPesos PesosHBM;
strPilha.idxPonteiro = 0;
strPilha.iVazio = 1;
}
app.c
Code:
strPesos PesosHBM;
CriarPilha(PesosHBM);
InserePilha(PesosHBM, 40);
InserePilha(PesosHBM, 50);
InserePilha(PesosHBM, 60);
sprintf(strTestePilha, "%d", PegarPilha(PesosHBM));
display_setcurpos(1,10);
display_print(strTestePilha);
Error:
util.c: In function ‘CriarPilha’:
util.c:49: error: request for member ‘idxPonteiro’ in something not a structure or union