为什么这个程序跑不到 输出3里头呢?? void usb_interrupt(void) interrupt 13 { printf(0x90,"0",1); if(UEPINT&EP0INT) { UEPNUM=0; printf(0x91,"1",1); if ((UEPSTAX&RXSETUP) && (!Setup_packet)) { printf(0x92,"2",1); Setup_packet=1; UEPSTAX= UEPSTAX & (~0x04); return; } if ((UEPSTAX&RXOUTB0) && Setup_packet) { printf(0x93,"3",1); Setup_packet=0; UEPSTAX= UEPSTAX & (~0x42); read_endpoint_buf(ENDPOINT0,32,control_data_buff.pData); //读端点0的FIFO requestcmd.bmRequestType=control_data_buff.pData[0]; requestcmd.bRequest=control_data_buff.pData[1]; requestcmd.wValue=(control_data_buff.pData[3]<<8)+control_data_buff.pData[2]; requestcmd.wIndex=(control_data_buff.pData[5]<<8)+control_data_buff.pData[4]; requestcmd.wLength=(control_data_buff.pData[7]<<8)+control_data_buff.pData[6]; if (requestcmd.bmRequestType & 0x60==0) //是USB标准请求吗? { printf(0x94,"4",1); switch(requestcmd.bRequest) { case get_status :printf(0x80,"1",1);Get_Status(requestcmd.bmRequestType&0x03); break; case clear_ferture :printf(0x81,"2",1);break;//Clear_Ferture(); break; case set_feature :printf(0x82,"3",1);break;//Set_Feature(); break; case set_address :printf(0x83,"4",1);break;//Set_Address(); break; case get_descriptor :printf(0x84,"5",1);Get_Descriptor(requestcmd.wValue,requestcmd.wLength); break; case get_configuration:printf(0x85,"6",1);break;//Get_Configuration();break; case set_configuration:printf(0x86,"7",1);break;//Set_Configuration();break; case get_interface :printf(0x87,"8",1);Get_Interface(); break; case set_interface :printf(0x88,"9",1);break;//Set_Interface(); break; default :printf(0x89,"a",1);break; } return; } else if (requestcmd.bmRequestType==0xa1) //设备类请求, { //.... } } } if(UEPINT&EP1INT) { //...... } if(UEPINT&EP2INT) { //...... } } |