在一个工程里编译没问题,在另一个工程里就有问题,代码完全一样。
Error - file './timer.o', section 'InterruptVectorHigh', Symbol 'InterruptHandler' out of range of relative branch instruction.
Errors : 1
//中断处理
#pragma code
#pragma interrupt InterruptHandler
void InterruptHandler(void)
{
if(INTCONbits.TMR0IF==1)//1mS
{
TMR0L|=TIMER0_1MS_LOW;
INTCONbits.TMR0IF=0; // reset int0 flag
time_1ms_flag=1;
}
}
//串口\timer0中断函数
#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh(void)
{
_asm
bra InterruptHandler
_endasm
}
注释掉如下就没问题“#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh(void)
{
_asm
bra InterruptHandler
_endasm
}” |