按照你说的方法,如果把中断模式设置为1,则会出现我上面说的一直产生控制输入的中断,设为0则不会,看了调试信息之后我发现确实是没有收到PC机的应答,会不会是这个控制输入中断其实是“NAKing”产生的呢?可能主要的问题是主机没有应答,不知道是为啥?<br /><br />以下是我的调试信息:<br /><br />Get IntNO=0x80<br />Get IntNO=0x40<br /><br /><font color=#800000>得到控制输出中断:<br /></font>Get IntNO=0x01,Now in control out.<br /><br /><font color=#800000>得到PC发来的请求命令,进入GetDescriptor:</font><br />Get Command=0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00 <br />Now in UsbGetDescriptor ().Get Device Descriptor.<br /><br /><font color=#800000>向PC发送Dev配置数据:</font><br />Device Send Data=0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x10 0x71 0x04 0x22 0x02 0x13 0x01 0x00 0x00 <br /><br /><font color=#800000>发送完毕产生控制输入中断,最大包16,再发剩余的数据:</font><br />Get IntNO=0x02,NOw in control In.<br />Device Send Data=0x00 0x01 <br /><br /><font color=#800000>?????<---------按理PC在这里应该返回应答的,但是没收到。</font><br /><br /><font color=#800000>复位,进入Set地址:</font><br />Get IntNO=0x40<br />Get IntNO=0x01,Now in control out.<br />Get Command=0x00 0x05 0x01 0x00 0x00 0x00 0x00 0x00 <br />Now in Get SetAddress().<br /><br /><font color=#800000>发送0数据,完成产生输入中断:</font><br />Device Send Data=<br />Get IntNO=0x02,NOw in control In.<br /><br /><font color=#800000>继续GetDescriptor:</font><br />Get IntNO=0x01,Now in control out.<br />Get Command=0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00 <br />Now in UsbGetDescriptor ().Get Device Descriptor.<br />Device Send Data=0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x10 0x71 0x04 0x22 0x02 0x13 0x01 0x00 0x00 <br /><br />Get IntNO=0x02,NOw in control In.<br />Device Send Data=0x00 0x01 <br />Get IntNO=0x02,NOw in control In.<br /><br />Get IntNO=0x01,Now in control out.<br />Get Command=0x80 0x06 0x00 0x02 0x00 0x00 0x09 0x00 <br />Now in UsbGetDescriptor ().Get Config descriptor.<br />Device Send Data=0x09 0x02 0x20 0x00 0x01 0x01 0x00 0x80 0x32 <br /><br />Get IntNO=0x02,NOw in control In.<br /><br />Get IntNO=0x01,Now in control out.<br />Get Command=0x80 0x06 0x00 0x02 0x00 0x00 0xFF 0x00 <br />Now in UsbGetDescriptor ().Get Config descriptor.<br />Device Send Data=0x09 0x02 0x20 0x00 0x01 0x01 0x00 0x80 0x32 0x09 0x04 0x00 0x00 0x02 0x08 0x04 <br /><br />Get IntNO=0x02,NOw in control In.<br />Device Send Data=0x50 0x00 0x07 0x05 0x82 0x02 0x40 0x00 0x00 0x07 0x05 0x02 0x02 0x40 0x00 0x00 <br /><br />Get IntNO=0x02,NOw in control In.<br /><br /><font color=#800000>按照正常的顺序,最后这里应该是接收到PC返回的一个应答,然后PC机就会开始寻找驱动安装了,但是我的却一直停在这里了,一段时间后被挂起了。如果中断模式设为1就是会一直出现Get IntNO=0x02,NOw in control In.</font>
|