#include "eint.h"

void EINT_Test(void)
{
	P4CR = 0xF0;
	P4 = 0x00;
	
	P0CR &= 0x7F;
	P0PCR |= 0x80;
	
	P1CR &= 0xFE;
	P1PCR |= 0x01;
	
	P2CR &= 0xFD;
	P2PCR |= 0x02;
	
	INTEN = 0x01;		//使能P10引脚外部中断		等效于EN40=1
	INTCTRL |= 0x01;		//INT0下降沿产生中断	默认INT0 P07作为输入
	INTCTRL |= 0x04;		//INT1下降沿产生中断
	INTCTRL |= 0x10;		//INT4下降沿产生中断
	
	EA = 1;
	IEN0 |= 0x01;		//IE0 = 1;使能INT0
	IEN0 |= 0x04;		//IE2 = 1;使能INT1
	IEN2 |= 0x01;		//IE12 = 1;使能INT4
//	INTCTRL |= 0xC0;		//INT1源选择WT溢出信号，INT0选择WDT匹配信号
	
	while(1);
}