智能车制作

标题: 求达人指教 [打印本页]

作者: zay    时间: 2009-2-18 17:46
标题: 求达人指教
程序运行到EnableInterrupts处就死掉了,求各位大虾帮助!

#pragma CODE_SEG NON_BANKED
void interrupt 8 RTI_ISR(void)
{
    Time++;
    CRGFLG = 0x80;       //清除实时中断标志位
}
#pragma CODE_SEG DEFAULT
void RTIInit(void) {
        RTICTL = 0x10;     
}

void StartTime(void)
{
  
    Time = 0;
    RTIInit();
    CRGINT = 0x80;        /* 使能 RTI interrupts */
    EnableInterrupts;
}
作者: chiusir    时间: 2009-2-18 21:21
本帖最后由 chiusir 于 2009-2-18 21:22 编辑

如果用DG128,XS128等,实时中断号都是是7,不是8,把那一句改为:
void interrupt 7 RTI_ISR(void)
就可以了!
作者: zay    时间: 2009-2-19 16:23
2# chiusir
作者: zay    时间: 2009-2-19 16:25
谢了,是中断号弄错了!
作者: whut_wj    时间: 2009-2-21 09:47
中断号到头文件里看,也可以看DS的中断向量表.
作者: xiaoyang06022    时间: 2010-4-17 00:12





欢迎光临 智能车制作 (http://111.231.132.190/) Powered by Discuz! X3.2