OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 8325|回复: 1

C语言问题

[复制链接]

54

主题

100

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
432
金钱
432
注册时间
2013-5-8
在线时间
33 小时
发表于 2013-8-7 13:02:17 | 显示全部楼层 |阅读模式
#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)
请问一下他们这些定义是什么意思哈?
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

70

主题

6769

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
13157
金钱
13157
注册时间
2012-11-26
在线时间
3817 小时
发表于 2013-8-7 13:26:21 | 显示全部楼层
回复【楼主位】zdyzczq:

#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)
请问一下他们这些定义是什么意思哈?

---------------------------------
a为0   引脚电平为0   a为1  引脚电平为1

换行符
学无止境
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-15 15:07

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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