I'm working on a driver for the Microchip Harmony Framework. It looks like a Linux driver. I've got a struct (NRF24L01_MainStateInfo) that stores all the state needed by the driver, it's just a "collection" made of enums. It's been like 2 days that I'm struggling to this:
../../../../framework/driver/nrf24l01/src/states/initialization_state/../../../drv_nrf24l01.h:51:2: error: unknown type name 'NRF24L01_MainStateInfo''
The struct that has a member of that type (and where the error points) is the following one:
#ifndef __DRV_NRF24L01_H__
#define __DRV_NRF24L01_H__
// Framework include
//...
// Project specific include
#include "src/memory_map.h"
#include "src/nrf_definitions.h"
#include "src/states/drv_nrf24l01_main_state.h" // NRF24L01_MainStateInfo defined here
#include "src/bus/drv_nrf24l01_bus.h"
//...
typedef struct _nrf24l01_driver_info {
// Driver in use? (already configured)
bool inUse;
// Driver's mutex
OSAL_MUTEX_HANDLE_TYPE drvMutex;
// Driver configuration
NRF24L01_ConfigData config;
// Client count. Useless since there is a mapping 1:1 between driver and client
uint8_t clientCnt;
// Driver system status (returned by status)
SYS_STATUS status;
// FSM state
NRF24L01_MainStateInfo state; // <-- This member generate the error
// Bus information
NRF24L01_BusVTable vTable;
void *busInfo;
} NRF24L01_DriverInfo;
//...
#endif
The structure NRF24L01_MainStateInfo is declared in src/states/drv_nrf24l01_main_state.h as follow:
#ifndef __DRV__NRF24L01_MAIN_STATE_H__
#define __DRV__NRF24L01_MAIN_STATE_H__
//#include "../../drv_nrf24l01.h"
#include "initialization_state/drv_nrf24l01_init_state.h"
struct _nrf24l01_driver_info;
/*
Main driver state. These are the state that the developer will see.
*/
typedef enum {
NRF24L01_MAIN_STATE_UNINITIALIZED = 0,
NRF24L01_MAIN_STATE_INITIALIZATION,
NRF24L01_MAIN_STATE_RUNNING,
NRF24L01_MAIN_STATE_CLOSING,
NRF24L01_MAIN_STATE_CLOSED
} NRF24L01_MAIN_STATE;
typedef struct _nrf24l01_mainstate_info {
NRF24L01_MAIN_STATE mainState;
NRF24L01_INIT_STATE initState;
} NRF24L01_MainStateInfo;
int32_t DRV_nRF24L01_MainStateTask(struct _nrf24l01_driver_info *pDrv);
#endif /* end of include guard: __DRV__NRF24L01_MAIN_STATE_H__ */
Now I can't figure why this error came up.
The directory tree is the following:
nrf24l01 .
│ drv_nrf24l01.h
│ LICENSE
│ README.md
│
├───config
│ .gitignore
│ drv_nrf.hconfig
│ drv_nrf24l01.hconfig
│ drv_nrf24l01_idx.ftl
│
├───src
│ │ drv_nrf24l01.c
│ │ memory_map.h
│ │ nrf_definitions.h
│ │
│ ├───bus
│ │ │ drv_nrf24l01_bus.h
│ │ │
│ │ └───spi
│ │ drv_nrf24l01_spi.c
│ │ drv_nrf24l01_spi.h
│ │
│ ├───internal
│ │ drv_nrf_internal.c
│ │ drv_nrf_internal.h
│ │
│ └───states
│ │ drv_nrf24l01_main_state.c
│ │ drv_nrf24l01_main_state.h
│ │
│ ├───closing_state
│ ├───initialization_state
│ │ drv_nrf24l01_init_state.c
│ │ drv_nrf24l01_init_state.h
│ │
│ └───running_state
└───templates
system_config.h.ftl
system_definitions.h.INC.ftl
system_definitions.h.OBJ.ftl
system_init.c.DRV.ftl
system_init.c.INIT.ftl
system_interrupt.c.ftl
system_tasks.c.ftl
Maybe I'm missing something?
The compiler is the xc32-gcc and the uC is a PIC32MX110F016B.