Post Go back to editing

keil4 ADUC7020 中断问题

正在用keil进行aduc7020编程,一直进不了中断。根据一些书上7026的timer1实例改了试并不行。有大神表示可能是预定义那里没有填,但并没有搜到该如何填写。

求帮忙,不知道到底问题出在哪了。

相关代码资料如下:

timer1中断代码

#include<Aduc7020.h>

void IRQ_Handler(void) __irq;  // IRQ Function Prototype

void delay(int lengh);

 

void SysClkInit(void) //clock  

{  

PLLKEY1 = 0xAA;

PLLCON = 0x01;

PLLKEY2 = 0x55;

POWKEY1 = 0x01;

POWCON = 0x00;

POWKEY2 = 0xF4;

}

int main (void) 

{

SysClkInit();

T1LD = 0x500000;

T1CON = 0xC4; // Enable Timer, Periodic and Core CLK

IRQEN = 0x08;

DAC3CON = 0x33; // DAC configuration

while(1){}

}

void IRQ_Handler() __irq

{

   if ((IRQSTA & GP_TIMER_BIT) != 0)

   {

DAC3DAT=0x08080000;

delay(10000);

DAC3DAT=0x00080000;

}

return;

}

void delay(int lengh)

{

while(lengh>0)

lengh--;

}

仅仅在project里加载此代码和头文件时候,会报以下错误:

.\123.axf: Error: L6218E: Undefined symbol DAbt_Handler (referred from aduc702x.o).

.\123.axf: Error: L6218E: Undefined symbol FIQ_Handler (referred from aduc702x.o).

.\123.axf: Error: L6218E: Undefined symbol PAbt_Handler (referred from aduc702x.o).

.\123.axf: Error: L6218E: Undefined symbol SWI_Handler (referred from aduc702x.o).

.\123.axf: Error: L6218E: Undefined symbol Undef_Handler (referred from aduc702x.o).

在另外加了以下c文件后,不再报错。(求问这些没有用到的寄存器可不可以不定义?如果不定义的话是否要更改头文件?)

/*    Function Pointers for Interrupts  */

typedef void (* tyVctHndlr) (void);

tyVctHndlr    IRQ     = (tyVctHndlr)0x0;

tyVctHndlr    SWI     = (tyVctHndlr)0x0;

tyVctHndlr    FIQ     = (tyVctHndlr)0x0;

tyVctHndlr    UNDEF   = (tyVctHndlr)0x0;

tyVctHndlr    PABORT  = (tyVctHndlr)0x0;

tyVctHndlr    DABORT  = (tyVctHndlr)0x0;

//void IRQ_Handler   (void) __irq;

void SWI_Handler   (void) __irq;

void FIQ_Handler   (void) __irq;

void Undef_Handler (void) __irq;

void PAbt_Handler  (void) __irq;

void DAbt_Handler  (void) __irq;

//void IRQ_Handler(void) __irq

//{

// if ( *IRQ !=0x00)

// {

// IRQ();

// }

//}

void FIQ_Handler(void) __irq

{

if ( *FIQ !=0x00)

{

FIQ();

}

}

void SWI_Handler(void) __irq

{

if ( *SWI !=0x00)

{

SWI();

}

}

void Undef_Handler(void)__irq

{

if ( *UNDEF !=0x00)

{

UNDEF();

}

}

void PAbt_Handler(void) __irq

{

if ( *PABORT !=0x00)

{

PABORT();

}

}

void DAbt_Handler(void) __irq

{

if ( *DABORT !=0x00)

{

DABORT();

}

}

然后咨询了常做嵌入式开发的人,表示可能问题出在预定义没有填