//-------------------------------------------------------------------------
void init_exint2(void)
{
//P0.6:INT2---input port & pull high
P0CR &= ~BIT_6;
P0PCR |= BIT_6;
//IT3=1;//falling edge trig
//IE0=0;
//IPH0|=0x01;//PX0H //exint 0 interrupt priority 2
//priority affect timer3
#if 1
IT20=0;
IT21=1;//rising edge trigger
#else
IT20=1;
IT21=0;//falling edge trigger
#endif
IE2=0;
//--interrupt priority
//IPL1|=BIT_1;
//IPH1|=BIT_1;
IEN1|=BIT_1;//enable external interrupt 2
}
//-------------------------------------------------------------------------
void exint2(void) interrupt 8 //IR
{
}
中断2死活进不去 |