I don't know about all the "::", that looks like a mess. This compiles under IDE 1.0.3 (not 1.0.2):
typedef struct pindef_
{
String name;
int address;
int reg;
int pin;
boolean inout;
boolean state;
};
void myFunc(pindef_ p); // function prototype
pindef_ LHInd = {"LHInd", 0x20, 0x00, 1, 1, 0};
pindef_ RHInd = {"RHInd", 0x21, 0x01, 1, 1, 0};
void setup()
{
Serial.begin(9600);
}
void myFunc(pindef_ p)
{
Serial.println (p.name);
Serial.println (p.address);
Serial.println (p.reg);
Serial.println (p.pin);
Serial.println (p.inout);
Serial.println (p.state);
}
void loop()
{
myFunc (LHInd);
myFunc (RHInd);
}
Warning:
Please note that, at present, the
String library has bugs as discussed
here and
here.
In particular, the dynamic memory allocation used by the String class may fail and cause random crashes.
I recommend reworking your code to manage without String. Use C-style strings instead (strcpy, strcat, strcmp, etc.).