O
Onno
Hi,
I want to use a pointer to a methode that has a struct (i2cmessage_t) as a
parameter. This struct should have the pointer to the previously defined
methode as one of its members.
The code is below.
typedef void (*i2c_callback) (i2cmessage_t);
typedef struct{
slaveAddress_t slaveAddress;
uint8_t * sendBuffer;
uint8_t sendBufferLength;
uint8_t * receiveBuffer;
uint8_t receiveBufferLength;
i2c_callback callbackFunction;
} i2cmessage_t;
when I compile this code, gcc (actualy avr-gcc) generates a warning:
"parameter names (without types) in function declaration"
Obviously, this is not going to work.
How do I declare both types and have them refer to eachother. Is it
posible to write a forward declaration of a type or something?
Thanks in advanced.
grz,
Onno
I want to use a pointer to a methode that has a struct (i2cmessage_t) as a
parameter. This struct should have the pointer to the previously defined
methode as one of its members.
The code is below.
typedef void (*i2c_callback) (i2cmessage_t);
typedef struct{
slaveAddress_t slaveAddress;
uint8_t * sendBuffer;
uint8_t sendBufferLength;
uint8_t * receiveBuffer;
uint8_t receiveBufferLength;
i2c_callback callbackFunction;
} i2cmessage_t;
when I compile this code, gcc (actualy avr-gcc) generates a warning:
"parameter names (without types) in function declaration"
Obviously, this is not going to work.
How do I declare both types and have them refer to eachother. Is it
posible to write a forward declaration of a type or something?
Thanks in advanced.
grz,
Onno