#include "2410lib.h"
#include "2410addr.h"
#include "timer.h"
//KEY10->EINT0
void __irq Eint0Handler();
int Main()
{
SetClockDivider(1, 1);
SetSysFclk(DFT_FCLK_VAL);
Port_Init();
Uart_Select(0);
Uart_Init(0, UART_BAUD);
rGPFCON=(rGPFCON|0x01)&0xFFFFFFFE;//GPF0设置为EINT0
rGPFUP|=0x01; //disable GPF0 pull up
//设置GPE11为输出0
rGPECON=(rGPFCON|0xC00000)&0xFF7FFFFF;
rGPEUP|=0x800;
rGPEDAT&=0xF7FF;
pISR_EINT0=(unsigned)Eint0Handler;
rEXTINT0 &= ~(7);
rEXTINT0 |= (2); //set eint0 falling edge int
EnableIrq(BIT_EINT0);//开中断
while(1)
{
Uart_Printf("the main is running\n");
Delay(500);
}
}
阅读(1138) | 评论(0) | 转发(0) |