打印

USB中断进不去

[复制链接]
1314|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
yangmiao0223|  楼主 | 2013-9-28 10:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
USB, se, TE, AD, TI
本帖最后由 yangmiao0223 于 2013-9-28 10:16 编辑

求各位分析下,有些usb有些中断能进去,有些进不去。

如果代码中红色颜色语句表示的中断能进去的话,发送数据就是成功的;如果红色的一直没进去过,就发送不成功,如此贴显示https://bbs.21ic.com/icview-607958-1-1.html

现在基本找到症结了,就是那个中断进不去导致的。但是不知道是什么原因导致红色中断进去?
红色的表示进不去的中断,这个中断是干嘛的?FF PF EF 分别表示什么意思??代码中其他颜色的是可以进去的,大家帮下忙分析下好么,谢谢了

求帮忙解答下:
1.红色中断表示什么意思或者表示usb什么状态?
2.FF PF EF 分别表示什么意思??
3.怎么解决中断进不去。

小弟不是学usb的,但是板子遇到了usb问题,需要我解决,这个又比较急,好心人,拜托了,再次谢谢,好人一生平安!!

irqValue = *USB_COMMAND;    //xiejin 地址是0x4004
    switch(irqValue)//xiejin 判断中断类曛荆餮分凶飨嘤Φ拇?
        {
        case SX2_INT_SETUP:
            /* endpoint 0 setup */
            /* next eight interrupts are setup data */
            /* parse the interrupt register value */
            setupDat = TRUE;
            setupCnt = 0;
            /* send read register command to SX2 */
            *USB_COMMAND = 0xC0 | SX2_SETUP;
            break;

        case SX2_INT_EP0BUF:
           /* endpoint 0 ready */
            sx2EP0Buf = TRUE;
            break;

       case SX2_INT_FLAGS:
            /* FIFO flags -FF,PF,EF */
            FLAGS_READ = TRUE;
            if(CyUsbSendReady ==1)
                CY_DataDeal();
            break;

        case SX2_INT_ENUMOK:
            /* enumeration successful */
            sx2EnumOK = TRUE;
            break;

        case SX2_INT_BUSACTIVITY:
/* detected either an absence or resumption of activity on the USB bus.  */
/* Indicates that the host is either suspending or resuming or that a   */
/* self-powered device has been plugged into or unplugged from the USB.  */
/* If the SX2 is bus-powered, the host processor should put the SX2 into */
/* a low-power mode after detecting a USB suspend condition.    */
            sx2BusActivity = TRUE;
            LED = 0;  //USB数据线拔出后熄灭LED
            ReloadDesctbl = 1;
            CY_DataDeal();
            break;

        case SX2_INT_READY:
            /* awakened from low power mode via wakeup pin */
            /* or completed power on self test */
            sx2Ready = TRUE;
            break;
        default:
            break;

相关帖子

沙发
yangmiao0223|  楼主 | 2013-9-28 10:16 | 只看该作者
和一楼一样,用代码框显示是:
irqValue = *USB_COMMAND;    //xiejin 地址是0x4004

    switch(irqValue)//xiejin 判断中断类曛荆餮分凶飨嘤Φ拇?
        {
        case SX2_INT_SETUP:
            /* endpoint 0 setup */
            /* next eight interrupts are setup data */
            /* parse the interrupt register value */
            setupDat = TRUE;
            setupCnt = 0;
            /* send read register command to SX2 */
            *USB_COMMAND = 0xC0 | SX2_SETUP;
            break;

        case SX2_INT_EP0BUF:
           /* endpoint 0 ready */
            sx2EP0Buf = TRUE;
            break;

        case SX2_INT_FLAGS:
            /* FIFO flags -FF,PF,EF */
            FLAGS_READ = TRUE;
            if(CyUsbSendReady ==1)
                CY_DataDeal();
            break;

        case SX2_INT_ENUMOK:
            /* enumeration successful */
            sx2EnumOK = TRUE;
            break;

        case SX2_INT_BUSACTIVITY:
/* detected either an absence or resumption of activity on the USB bus.         */
/* Indicates that the host is either suspending or resuming or that a          */
/* self-powered device has been plugged into or unplugged from the USB.         */
/* If the SX2 is bus-powered, the host processor should put the SX2 into */
/* a low-power mode after detecting a USB suspend condition.                         */
            sx2BusActivity = TRUE;
            LED = 0;                //USB数据线拔出后熄灭LED
            ReloadDesctbl = 1;
            CY_DataDeal();
            break;
        case SX2_INT_READY:
            /* awakened from low power mode via wakeup pin */
            /* or completed power on self test */
            sx2Ready = TRUE;
            break;

        default:
            break;
      }

使用特权

评论回复
板凳
yangmiao0223|  楼主 | 2013-9-28 10:21 | 只看该作者
@beyond696 有点急,at几位一下@yezhenqin   ,不好意思,也请没at到的各位帮忙解答下好么

使用特权

评论回复
地板
yezhenqin| | 2013-10-8 14:43 | 只看该作者
真心抱歉,这个我也不懂

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

9

主题

83

帖子

0

粉丝