本帖最后由 tingbaby_zj 于 2011-5-29 17:09 编辑
调试外部中断唤醒掉电程序时,遇到一个问题;程序实现掉电唤醒时蜂鸣器鸣响切换;
#define BEEP 1<<7;
/******************************************
**
*******************************************/
void __irq IRQ_Eint0(void)
{
while((EXTINT & 0X01)!=0)
{
EXTINT = 0X01;
}
VICVectAddr =0;
}
int main (void)
{
PINSEL0 = 0X00000000;
PINSEL1 = 0X00000001;
IO0DIR = BEEP;
IRQEnable();
VICIntSelect = 0x00000000;
VICVectCntl0 = 0x20|14;
VICVectAddr0 = (uint32)IRQ_Eint0;
VICIntEnable = 1<<14;
EXTWAKE = 0x01;
EXTINT = 0x01;
IO0SET =BEEP;
while(1)
{
PCONP = 0x00;
PCON = 0x02;
if((IO0SET & BEEP)==0) { IO0SET = BEEP;}
else IO0CLR = BEEP;
}
return 0;
}
调试时,在 if((IO0SET & BEEP)==0) { IO0SET = BEEP;}
else IO0CLR = BEEP;
出现以下错误提示:
ERROR:(serious)C2282e:expected ‘)’-inserted before ‘;’
ERROR:(serious)C2282e:<command> expected but found ')'
ERROR:(serious)C2282e:misplaced 'else' ignored |