请大家帮忙看一下这个程序为什么不能进中断,谢谢
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "2410addr.h"
#include "option.h"
#include "strata16.h"
#define _ISR_STARTADDRESS 0x33ffff00
#define U32 unsigned int
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
unsigned char const LED_TAB[] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71 };
//================灯的定义=========================================
#define LED1_ON() (rGPFDAT &= ~0x10)
#define LED2_ON() (rGPFDAT &= ~0x20)
#define LED3_ON() (rGPFDAT &= ~0x40)
#define LED4_ON() (rGPFDAT &= ~0x80)
#define LED1_OFF() (rGPFDAT |= 0x10)
#define LED2_OFF() (rGPFDAT |= 0x20)
#define LED3_OFF() (rGPFDAT |= 0x40)
#define LED4_OFF() (rGPFDAT |= 0x80)
//==========================================================================
void __irq TIMER0_ISR(void)
{
rSRCPND = rSRCPND|(0x1<<10);
rINTPND = rINTPND|(0x1<<10);
LED1_ON();
LED2_ON();
LED3_ON();
LED4_ON();
}
//==========================================================================
void delay1()
{
int i;
for(i=1;i<15000;i++)
{
int j;
for (j=0;j<10;j++);
}
}
//==============================================================================
void Main(void)
{
//============================================================================
rSRCPND = rSRCPND|(0x1<<10); //将源悬挂寄存器清零
rINTMSK = rINTMSK&~(0x1<<10); //打开屏蔽
rINTPND = rINTPND|(0x1<<10); //将中断悬挂寄存器清零
rTCFG0 = rTCFG0|0xFF;
rTCFG0 = rTCFG0&0xf9; //配置预分频数
rTCFG1 = rTCFG1&~0xf;
rTCFG1 = 0x2; //配置时钟分割器
rTCNTB0 = 12500; //填充值
rTCON = rTCON&~0xf;
rTCON = 0x3;
rTCON = rTCON&~0x6; //开启定时器
pISR_TIMER0 = (U32)TIMER0_ISR; //映射地址
while(1)
{
LED1_ON();
delay1();
LED1_OFF();
LED2_ON();
delay1();
LED2_OFF();
LED3_ON();
delay1();
LED3_OFF();
LED4_ON();
delay1();
LED4_OFF();
printf("fftchina");
}
} |