Skip to main content
Visitor II
June 27, 2007
Question

USB Library : how to make ControlOut with data ?

  • June 27, 2007
  • 2 replies
  • 713 views
Posted on June 27, 2007 at 02:57

USB Library : how to make ControlOut with data ?

    This topic has been closed for replies.

    2 replies

    Visitor II
    March 26, 2007
    Posted on March 26, 2007 at 04:36

    for ControlOut with data, i think it is follow:

    Setup Data0 Ack

    Out Data1 ack

    ....

    Out Data1/0 ack

    In Data1 ack

    void My_Status_In (void)

    {

    //process recived data <===== the code can not be executed

    }

    but for ControlOut without data, it can be executed.

    where is error ? I use STR710 and IAR.

    [ This message was edited by: shangdawei on 26-03-2007 08:08 ]

    Visitor II
    June 27, 2007
    Posted on June 27, 2007 at 02:57

    usb_core.c

    /*******************************************************************************

    * Function Name : Out0_Process

    * Description : Process the OUT token on all default endpoint

    * Input :

    * Output :

    * Return :

    *******************************************************************************/

    u8 Out0_Process(void)

    {

    u32 ControlState = pInformation->ControlState;

    if(ControlState == OUT_DATA || ControlState == LAST_OUT_DATA)

    {

    DataStageOut();

    ControlState = pInformation->ControlState; /* may be changed outside the function */ /* Add for Control Out with Data */

    }

    else if (ControlState == WAIT_STATUS_OUT) {

    (*pProperty->Process_Status_OUT)();

    ControlState = STALLED;

    }

    else if (ControlState == IN_DATA || ControlState == LAST_IN_DATA) {

    /* host aborts the transfer before finish */

    ControlState = STALLED;

    }

    /* Unexpect state, STALL the endpoint */

    else {

    ControlState = STALLED;

    }

    pInformation->ControlState = ControlState;

    return Post0_Process();

    } /* Out0_Process */