void Chap9_StallEP0InControlRead(void) { Hal4D13_StallEP0InControlRead(); RaiseIRQL(); if(!ControlData.Abort) { bD13flags.bits.DCP_state = USBFSM4DCP_STALL; } LowerIRQL(); }
void Isr_Ep00TxDone(void) { short i = ControlData.wLength - ControlData.wCount; UCHAR ep_last; Hal4D13_ReadInterruptRegister(); ep_last = Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP0_CONTROL_IN); /* Clear interrupt flag */ switch (bD13flags.bits.DCP_state) { case USBFSM4DCP_HANDSHAKE: break; case USBFSM4DCP_DATAIN: if( i >= EP0_PACKET_SIZE) { Hal4D13_WriteEndpoint(EPINDEX4EP0_CONTROL_IN,ControlData.Addr.pData + ControlData.wCount, EP0_PACKET_SIZE); ControlData.wCount += EP0_PACKET_SIZE; // State remains at USBFSM4DCP_DATAIN } else if( i != 0) { Hal4D13_WriteEndpoint(1, ControlData.Addr.pData + ControlData.wCount, i); ControlData.wCount += i; bD13flags.bits.DCP_state = USBFSM4DCP_HANDSHAKE; } else if (i == 0) { bD13flags.bits.DCP_state = USBFSM4DCP_HANDSHAKE; Hal4D13_SingleTransmitEP0(0, 0); } break; case USBFSM4DCP_REQUESTPROC: break; case USBFSM4DCP_IDLE: break; case USBFSM4DCP_SETUPPROC: break; case USBFSM4DCP_STALL: break; case USBFSM4DCP_DATAOUT: break; default: USB_ISR_DEBUG(("Fatal Error: Isr_Ep0TxDone Unexpected FSMState=%x\r\n",bD13flags.bits.DCP_state)); bD13flags.bits.DCP_state = USBFSM4DCP_STALL; Hal4D13_StallEP0InControlRead(); break; } }
void Chap9_StallEP0(void) { UCHAR dir; dir = ControlData.DeviceRequest.bmRequestType & USB_REQUEST_DIR_MASK; if(dir) { Hal4D13_StallEP0InControlRead(); } else { Hal4D13_StallEP0InControlWrite(); } RaiseIRQL(); if(!ControlData.Abort) { bD13flags.bits.DCP_state = USBFSM4DCP_STALL; } LowerIRQL(); }