打印

求助 为啥 else 后的语句无分号?

[复制链接]
272|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
喷水壶|  楼主 | 2018-7-4 15:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
se, pi, IO, gp, GPIO
这是配套程序,为啥 else 后的语句无分号?

#ifndef __LED_H
#define __LED_H
#include "stm32f10x.h"
/* the macro definition to trigger the led on or off
* 1 - off
- 0 - on
*/
#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 */

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

433

主题

437

帖子

0

粉丝