报错的大概意思是:
LCDdisplay.c(6):错误: # 77-D: 这个声明没有存储类型或类型说明符
LCDdisplay.c(6):错误: # 147: 声明与"unsigned char *PC1" (定义在5号线) 不相容
LCDdisplay.c(6):错误: # 144: 一个"unsigned char *"类型的值不能被用来初始化一个"int"类型的实体
不太明白,明明定义的是字符型的。好,如果STM32的类型就这些:
u8——1个字节,无符号型(不能表达负数,如果用来当作负数的话,就出错了);
u16 ——2个字节,无符号型(参看前边STM32f10x.h中的定义);
u32——4个字节,无符号型;
int——4个字节,有符号型,可以表达负整数;
float ——4个字节,有符号型,可以表达负数/小数;
double——8个字节,有符号弄,可以表达负数/小数;
那我把类型改成int得了吧,但是
int tmp[128];
int *PC1,*PC2,*PC3;
PC1=tmp;
LCDdisplay.c(6): error: #77-D: this declaration has no storage class or type specifier
LCDdisplay.c(6): error: #147: declaration is incompatible with "int *PC1" (declared at line 5)
LCDdisplay.c(6): error: #144: a value of type "int *" cannot be used to initialize an entity of type "int"
一个整形指针的值不能被用来初始化一个整形数的实体????(翻译没问题吧)但是我好像是在给指针赋值诶!
还有一个是
117 if (*PC1=='$'&*PC2=='G')
LCDdisplay.c(117): error: #75: operand of "*" must be a pointer
难道无法定义指针??
|