I have the following file structure
service.h
config.h
config.c
In the service.h file a struct serviceStruct is declared with one member a unsigned int.
I declare an array of serviceStructs in the file config.h and in the config.c file, I initialize the members.
Now I get the error array type has incomplete element type
How can i solve this error?
[update from comment:]
service.h:
typedef uint32_t board_spi_select_id_t;
struct spi_device
{ //! Board specific select id
board_spi_select_id_t id;
};
config.h:
#include "service.h"
#define SPI_SLAVE_COUNT 4
#define SPI_SS_ADF4350_C1 0
#define SPI_SS_ADF4350_C2 99
#define SPI_SS_AD9854_C1 3
#define SPI_SS_AD9854_C2 99
struct spi_device ssid[SPI_SLAVE_CNT];
config.c:
#include "config.h"
struct spi_device ssid[SPI_SLAVE_CNT] =
{
{ SPI_SS_ADF4350_C1 },
{ SPI_SS_ADF4350_C2 },
{ SPI_SS_AD9854_C1 },
{ SPI_SS_AD9854_C2 }
};
includeis missing somewhere?struct serviceStructsin the fileconfig.h