Tuesday, 6 August 2013

expected declaration specifiers or '...' before 'MLD_PACKET'

expected declaration specifiers or '...' before 'MLD_PACKET'

Wherever I include a certain 'commands.h' header file, in any place apart
from commands.c, this error is thrown up by the compiler. 'commands.h'
contains function prototypes which make use of structs defined in
'instrument.h', specifically:
void readConfig(PSTATPLUS_CONFIG* pStatConfig_p, MLD_PACKET*
rxPacketUart2_p);
void readState(PSTATPLUS_STATE* pStatState_p, MLD_PACKET* rxPacketUart2_p);
void writeConfig(PSTATPLUS_CONFIG* pStatConfig_p, MLD_PACKET*
rxPacketUart2_p);
void writeState(PSTATPLUS_STATE* pStatState_p, MLD_PACKET* rxPacketUart2_p);
PSTATPLUS_CONFIG and PSTATPLUS_STATE are defined as such, in 'instrument.h':
typedef struct {
float signalAmplitude; // Signal Amplitude
float signalOffset; // Signal Offset
unsigned char waveType; // Waveform Type
float startFreq; // Frequency Start
float stopFreq; // Frequency Stop
unsigned int numIncrements; // Number of Increments
unsigned char scale; // Linear(0) or log(1)
float stepDelay; // Step Delay
}PSTATPLUS_CONFIG;
typedef struct { // Current biosensor status
unsigned char scan; // Scan status (on/off)
unsigned char sample; // Sample status (on/off)
unsigned int currentIncrement; // Current scan increment
unsigned char gain; // Current gain setting
float iValue; // I voltage
float qValue; // Q voltage
unsigned int sampleDivider; // 1 takes every ADC sample, 2 takes every
2nd ADC sample, 3 takes every 3rd ADC samp... n takes every nth. 0
stops data collection.
unsigned int totalSamples; // total number of samples wanted to
complete one measurement.
}PSTATPLUS_STATE;
I require some definitions written in the commands.h header to be
accessible to my instrument.c file but as mentioned, every time I include
commands.h in there, the compiler produces that error. I've tried
including commands.h in some of my other source files, the same thing
keeps happening. Any help is appreciated.
Dan

No comments:

Post a Comment