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

[复制链接]
381|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

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