主题 : USB OTG 中断进不去怎么回事 源代码如下 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 105628
精华: 0
发帖: 32
金钱: 160 两
威望: 32 点
综合积分: 64 分
注册时间: 2014-06-30
最后登录: 2015-04-07
楼主  发表于: 2014-09-10 13:34

 USB OTG 中断进不去怎么回事 源代码如下


//中断程序
void __irq Isr_UsbOtg(void)            
{
    buzzer_on();
    
    INTC_Disable(NUM_OTG);                    //This function sets the corresponding bit of interrupt enable clear register
    
    OTGDEV_HandleEvent();                        //handles various OTG interrupts of Device mode
    
    INTC_Enable(NUM_OTG);                        //This function sets the corresponding bit of interrupt enable register
    
    INTC_ClearVectAddr();                        //clears the vector address register
}

//中断初始化
void USB_isr_init(void)
{
                //中断函数入口
        INTC_SetVectAddr(NUM_OTG, Isr_UsbOtg);
               //使能中断
        INTC_Enable(NUM_OTG);
}

int main(void)
{  
        u32  timeclick = 0 , i = 1;
                SYSTEM_InitException();
                SYSC_GetClkInform();
  
            INTC_Init();  
        GPIO_Init();
    
        //USB初始化  
        OTGDEV_InitOtg(USB_HIGH);
        USB_isr_init();
    
    while(1);
}
ADC中断 时钟中断 都成功了 就是这OTG中断 进不了中断程序 中断初始化函数和ADC、时钟是一样的就是改了下中断号 和中断入口 怎么不行了呢