|
楼主 |
发表于 2021-3-4 14:39:38
|
显示全部楼层
本帖最后由 pdshyh 于 2021-3-4 15:16 编辑
请教上面程序现在应该怎么修改,现在还有5处错误,比葫芦画瓢还行,稍有变动就蒙了 ,
*** Using Compiler 'V5.06 update 1 (build 61)', folder: 'C:\Program Files\keil\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling usart1.c...
usart1.c(182): error: #20: identifier "s" is undefined
s=va_arg(ap,const char *);
usart1.c(183): error: #65: expected a ";"
for( ; *s , s++)
usart1.c(186): warning: #223-D: function "whil" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(186): warning: #223-D: function "USART_GatFlagStatus" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(191): error: #20: identifier "d" is undefined
d =va_arg(ap,int);
usart1.c(192): warning: #223-D: function "intoa" declared implicitly
intoa(d,buf,10);
usart1.c(192): error: #20: identifier "buf" is undefined
intoa(d,buf,10);
usart1.c(196): warning: #223-D: function "whil" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(196): warning: #223-D: function "USART_GatFlagStatus" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(205): error: #127: expected a statement
else USART_SendData(USARTx,*Data++);
usart1.c(206): warning: #223-D: function "whil" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(206): warning: #223-D: function "USART_GatFlagStatus" declared implicitly
whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);
usart1.c(154): warning: #177-D: variable "a" was declared but never referenced
const char *a;
usart1.c(155): warning: #177-D: variable "bus" was declared but never referenced
char bus[16];
usart1.c(97): warning: #177-D: function "itoa" was declared but never referenced
static char *itoa(int value,char *string,int radix )
usart1.c: 10 warnings, 5 errors
"..\usart1.axf" - 5 Error(s), 10 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01
s /d/buf三个错误没定义,前面r和n语句相近没有定义确没有这个提示,什么原因?
205:else USART_SendData(USARTx,*Data++);错误需要声明,楼上老师提出else的 if / else if 是否 匹配完整, 不知道怎么匹配。
206:whil(USART_GatFlagStatus(USARTx,USART_FLAG_TC)==RESET);错误提示没有了不知道为什么。
补充内容 (2021-3-5 07:58):
205:else USART_SendData(USARTx,*Data++);错误查到了少了一个大括号
补充内容 (2021-3-5 08:04):
154const char *a;改为154const char *a,s,d;运行多了好几个错误 |
|