主题 : 关于Timer1中断的问题 复制链接 | 浏览器收藏 | 打印
向高手学习嘿嘿O(∩_∩)O~
级别: 新手上路
UID: 19433
精华: 0
发帖: 24
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 48 分
注册时间: 2010-04-19
最后登录: 2010-11-06
楼主  发表于: 2010-05-12 10:29

 关于Timer1中断的问题

在测试Timer1中断的时候出现错误:Undefined symbol MMU_Init
但是已经在文件中包含了mmu.h,高手给指点指点吧
向高手学习嘿嘿O(∩_∩)O~
级别: 新手上路
UID: 19433
精华: 0
发帖: 24
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 48 分
注册时间: 2010-04-19
最后登录: 2010-11-06
1楼  发表于: 2010-05-12 10:32
程序是:
//***************************************************
#include "def.h"
#include "option.h"
#include "2440addr.h"    
#include "2440lib.h"
#include "2440slib.h"  
#include "mmu.h"
//================================
#define GPB5_out    (1<<(5*2))   //led1
#define GPB6_out    (1<<(6*2))   //led2
#define GPB7_out    (1<<(7*2))   //led3
#define GPB8_out    (1<<(8*2))   //led4
#define GPB1_Timer  (0x2<<(1*2))
int i=0;
void __irq Timer1Done(void)
{
    Uart_Printf("Timer1  is occurred.\n");
    rSRCPND=(1<<rINTOFFSET);  //写1清中断
    rINTPND=rINTPND;   
}
int Main()
{
      MMU_Init();
   Uart_Printf("EINT0  is occurred.\n");
    rGPBCON=GPB5_out|GPB6_out|GPB7_out|GPB8_out|GPB1_Timer;  
    rINTMOD=0;
   rINTMSK&=0xffff7fff;         //开时钟1中断
  pISR_TIMER1=(U32)Timer1Done;  //设置中断1处理函数    
  rTCFG0=rTCFG0&~(0xffffffff)|(1);
   rTCFG1=rTCFG1&~(0xffffffff)|(0x00<<4);
   rTCNTB1=47625;
   rTCMPB1=(rTCNTB1>>1);    
rTCON=rTCON&~(0xf)|(1<<9); //手动装载
rTCON=(0x0D<<8);         //设置自动装载,开中断,翻转
    return 0;
}