不理解#define LED1(a)

[复制链接]
253|0
 楼主| 张さん 发表于 2019-11-21 09:50 | 显示全部楼层 |阅读模式
#define LED1(a) if (a)        \
                                        GPIO_SetBits(GPIOB,GPIO_Pin_0);\
                                        else                \
                                        GPIO_ResetBits(GPIOB,GPIO_Pin_0)
可不可以写成 #define LED1(a)  if(a) GPIO_SetBits(GPIOB,GPIO_Pin_0); else GPIO_ResetBits(GPIOB,GPIO_Pin_0)
还有为什么 LED(a)中的a为什么可以代替ON/OFF
您需要登录后才可以回帖 登录 | 注册

本版积分规则

448

主题

464

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部