野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15418|回复: 2

我照源代码写的,为啥还有这么多错误。请大家帮我看看。

[复制链接]
发表于 2015-4-22 22:05:29 | 显示全部楼层 |阅读模式
compiling main.c.....\..\User\LED\led.h(23): warning:  #1-D: last line of file ends without a newline
..\..\User\main.c(36): error:  #20: identifier "GPIO" is undefined
..\..\User\main.c(36): error:  #18: expected a ")"
..\..\User\main.c(36): error:  #18: expected a ")"
..\..\User\main.c(37): error:  #18: expected a ")"
..\..\User\main.c(37): error:  #18: expected a ")"
..\..\User\main.c(38): error:  #18: expected a ")"
..\..\User\main.c(38): error:  #18: expected a ")"
..\..\User\main.c(42): error:  #18: expected a ")"
这是错误  
36行          LED1( ON );                          // áá
37行                LED2( ON );                          // áá
38行         LED3( ON );                          // áá
                Delay(0x0FFFFF);
                Delay(0x0FFFFF);
                Delay(0x0FFFFF);
                LED1( OFF );                  // Ãe
                LED2( OFF );                  // Ãe
                LED3( OFF );                  // Ãe

回复

使用道具 举报

 楼主| 发表于 2015-4-22 22:06:15 | 显示全部楼层
#define ON 0
#define OFF 1
#define LED1(a) if (a)  \
                          GPIO_SetBits(GPIOC,GPIO Pin 3);\
                    else  \
                                                                                        GPIO_ResetBits(GPIOC,GPIO pin 3)
#define LED2(a) if (a)  \
                          GPIO_SetBits(GPIOC,GPIO Pin 4);\
                    else    \
                                                                                        GPIO_ResetBits(GPIOC,GPIO pin 4)
#define LED3(a) if (a)  \
                          GPIO_SetBits(GPIOC,GPIO Pin 5);\
                    else    \
                                                                                        GPIO_ResetBits(GPIOC,GPIO pin 5)       
void LED_GPIO_Config(void);
#endif /*__LED_H*/                               
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-4-22 22:06:36 | 显示全部楼层
这是写的led.h文件
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-9-20 16:38 , Processed in 0.039739 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表