I'm sure its something very foolish, but I'm stumped:
I have a typedef'd struct declared in one header:
Firstheader.h
typedef struct Pin
{
uint8_t a;
uint8_t b;
} PinStruct;
I then want to use this typedef'd struct in a function declaration in another header:
Secondheader.h
#include "Firstheader.h"
void foo (const PinStruct *myPin);
Despite the typedef'd struct being clearly defined in the first header, and including the first header in the second header, the compiler complains that the "identifier PinStruct is undefined". Someone please smack me and tell me what I'm missing.
EDIT: Thanks for the comments guys. The compiler is marking the function declaration in the second header as the source of the error. The exact error is just as I wrote: Error[Pe020]: identifier "PinStruct" is undefined.
What's strange is if I copy the struct definition into the Secondheader.h
header file, the compiler immediately complians about a re-definition of the struct. So it knows its there.