illegal use of 'pragma CODE_SEG/DATA_SEG/CONST_SEG. Two segments with different types have the same name
出错的位置:
#pragma CODE_SEG __NEAR_SEG NON_BANKED
__interrupt void CAN1_InterruptError(void);
#pragma CODE_SEG CAN1_CODE
#pragma CODE_SEG __NEAR_SEG NON_BANKED
ISR(CAN1_InterruptError)
{
byte Status = CAN0R**; /* Read the status register */
if((Status & CAN_STATUS_BOFF_MASK) == CAN_STATUS_BOFF_MASK) { /* Bus-Off state */
ErrFlag |= CAN_STATUS_BOFF_EXT_MASK;
ErrFlag |= (Status & 0x83U); /* Add error flags */
}
else {
ErrFlag |= (Status & 0xBFU); /* Add error flags */
}
CAN0R** = 0xFEU; /* Reset error flags */
if ((Status & CAN_STATUS_BOFF_MASK) == CAN_STATUS_BOFF_MASK) { /* Is busoff error detected? */
CAN1_OnBusOff(); /* If yes then invoke user event */
} else {
}
}
#pragma CODE_SEG CAN1_CODE
上面中中断函数的声明和定义都对应的同一个段,为什么还会报错!
而且上面这些都是PE自动生成的!为啥还会报错!
|