Ejemplo n.º 1
0
void Isr_Ep00RxDone(void)
{
    UCHAR       ep_last, i;
    USB_ISR_DEBUG(("RX %d\r\n",bUSBCheck_Device_State.State_bits.FOUR_RESERVED_BITS++));
    ep_last = Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP0_CONTROL_OUT); /* Clear interrupt flag */

    if (ep_last & D13REG_EPSTS_SETUP)
    {
        if(bD13flags.bits.DCP_state == USBFSM4DCP_REQUESTPROC)
        {
            ControlData.Abort = 1;
            bD13flags.bits.DCP_state = USBFSM4DCP_SETUPPROC;
        }
        else
            bD13flags.bits.DCP_state = USBFSM4DCP_SETUPPROC;
    }
    else /* not a setup packet, just a Data Out Packet */
    {
        switch (bD13flags.bits.DCP_state)
        {
        case USBFSM4DCP_DATAOUT:

            i = Hal4D13_ReadEndpoint(EPINDEX4EP0_CONTROL_OUT, ControlData.dataBuffer + ControlData.wCount,
                EP0_PACKET_SIZE);

            ControlData.wCount += i;
            if( i != EP0_PACKET_SIZE || ControlData.wCount >= ControlData.wLength)
            {
                bD13flags.bits.DCP_state = USBFSM4DCP_REQUESTPROC;

            }
            break;
        case USBFSM4DCP_HANDSHAKE:

            bD13flags.bits.DCP_state = USBFSM4DCP_IDLE;
            break;

        case USBFSM4DCP_STALL:      break;

        case USBFSM4DCP_SETUPPROC:  break;

        case USBFSM4DCP_REQUESTPROC:break;

        case USBFSM4DCP_DATAIN:     break;

        default:
            USB_ISR_DEBUG(("Fatal Error: Isr_Ep0RxDone ReadLastTranactionStatus=%x\r\n",ep_last));
            bD13flags.bits.DCP_state = USBFSM4DCP_STALL;
            Hal4D13_StallEP0InControlWrite();
            break;
        }
    }
    return ;
}
Ejemplo n.º 2
0
void Chap9_StallEP0InControlWrite(void)
{
    Hal4D13_StallEP0InControlWrite();

    RaiseIRQL();
    if(!ControlData.Abort)
    {
        bD13flags.bits.DCP_state = USBFSM4DCP_STALL;

    }
    LowerIRQL();
}
Ejemplo n.º 3
0
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();
}