int main(void)
{ na_interface->np_interfaceinterrupt=0x12345678;
na_interface->np_interfacechirpdata=0xabcd;
}
编译报错
cpu_sdk/src/example.c: In function `main':
cpu_sdk/src/example.c:13: warning: dereferencing `void *' pointer
cpu_sdk/src/example.c:13: request for member `np_interfaceinterrupt' in something not a structure or union
cpu_sdk/src/example.c:14: warning: dereferencing `void *' pointer
cpu_sdk/src/example.c:14: request for member `np_interfacechirpdata' in something not a structure or union作者: bluemelodyer 时间: 2004-12-23 16:41
仿照excalibur.h中pio的寄存器定义
// PIO Registers
typedef volatile struct
{
int np_piodata; // read/write, up to 32 bits
int np_piodirection; // write/readable, up to 32 bits
int np_piointerruptmask; // write/readable, up to 32 bits
int np_pioedgecapture; // read, up to 32 bits
} np_pio;
另外在reg_def.h中定义了数据结构体:
typedef volatile struct cntrl_reg
{
int D14_ADDRESS; //00H
int DUMMY_02; //02H
int D14_ENDPT_MAXPKTSIZE; //04H
int DUMMY_06; //06H
int D14_ENDPT_TYPE; //08H
} cntrl_reg;
但是编译的时候仍然报错:
cpu_sdk/src/example.c: In function `main':
cpu_sdk/src/example.c:9: request for member `D14_ADDRESS' in something not a structure or union