以下是我写的程式码参考新唐范例写的
发觉Complier 出现错误 : 85589.axf: Error: L6200E: Symbol TMR0_IRQHandler multiply defined (by 123.o and drvtimer.o).
请问是我少加了什麽文件或者程式码,麻烦解惑一下,感谢!!
#include "NUC1xx.h"
#include "Driver\DrvGPIO.h"
#include "Driver\DrvTIMER.h"
#include "Driver\DrvSYS.h"
void timer();
main()
{
timer();
while(1)
{
DrvGPIO_SetBit(E_GPA,1);
TIMER0->TCSR.CEN = 1;
DrvGPIO_ClrBit(E_GPA,1);
TIMER0->TCSR.CEN = 1;
}
}
void timer()
{
UNLOCKREG();
SYSCLK->PWRCON.XTL12M_EN = 1;
SYSCLK->CLKSEL0.HCLK_S = 0;
LOCKREG();
DrvGPIO_Open(E_GPA, 1, E_IO_OUTPUT);
DrvGPIO_Open(E_GPA, 0, E_IO_OUTPUT);
DrvGPIO_ClrBit(E_GPA,1);
SYSCLK->CLKSEL1.TMR0_S = 0;
SYSCLK->APBCLK.TMR0_EN =1;
NVIC_DisableIRQ(TMR0_IRQn);
TIMER0->TCSR.MODE=0;
TIMER0->TCSR.PRESCALE=0;
TIMER0->TCMPR=12000000;
TIMER0->TCSR.IE = 1;
TIMER0->TISR.TIF = 1;
NVIC_EnableIRQ(TMR0_IRQn);
}
void TMR0_IRQHandler(void)
{
TIMER0->TISR.TIF =1;
}
|