#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
//================================
static void __irq EINT0_ISR(void)
{
rSRCPND|=(1<<0);
rINTPND|=(1<<0);
rGPBDAT=0x01;//蜂鸣器向,led灯亮
}
void init()
{
rGPBUP&=0xf1e;
rGPBCON=0x155555;
rGPBDAT=0xffe;
rGPFCON=(rGPFCON|(1<<1)&~(1<<0));
rEXTINT0=(rEXTINT0|(1<<1)&~(1<<2));
rGPFUP&=0x001;
pISR_EINT0=(int)EINT0_ISR;
rINTMSK=rINTMSK&~(1<<0);
rINTMOD=rINTMOD&~(1<<0);
rEINTPEND=0XFF;
rSRCPND=0X01;
rINTPND=0x01;
}
void Main()
{
init();
while(1);
}
//求版主帮忙看一哈
|
|