本帖最后由 MIKEZHONG 于 2011-12-13 09:37 编辑
各位好,这个宏定义,为什么不行呢?提示出错。
#define PWM1OUTON() ((PORTCBUF |=0X01);(PORTC=PORTCBUF))
#define PWM1OUTOFF() ((PORTCBUF &=0X01); (PORTC=PORTCBUF))
#define PWM2OUTON() ((PORTCBUF |=0X02); (PORTC=PORTCBUF))
#define PWM2OUTOFF() ((PORTCBUF &=0X02); (PORTC=PORTCBUF))
#define PWM3OUTON() ((PORTCBUF |=0X04); (PORTC=PORTCBUF))
#define PWM3OUTOFF() ((PORTCBUF &=0X04); (PORTC=PORTCBUF))
#define PWM4OUTON() ((PORTCBUF |=0X08); (PORTC=PORTCBUF))
#define PWM4OUTOFF() ((PORTCBUF &=0X08); (PORTC=PORTCBUF))
#define PWM5OUTON() ((PORTCBUF |=0X10); (PORTC=PORTCBUF))
#define PWM5OUTOFF() ((PORTCBUF &=0X10); (PORTC=PORTCBUF))
#define PWM6OUTON() ((PORTCBUF |=0X20); (PORTC=PORTCBUF))
#define PWM6OUTOFF() ((PORTCBUF &=0X20); (PORTC=PORTCBUF))
//***************这里是错误提示**********************
Error [312] D:\YADON PROJECT20111208\ASIA project\HAOHUA_PRJ\HAOHUA_Driver_U1_A2\HAOHUA_slave_U1_A2_v10.C; 452.36 ";" expected
去掉中间的分号也不行。 |