cancel
Showing results for 
Search instead for 
Did you mean: 

USB Library : how to make ControlOut with data ?

shangdawei1
Associate II
Posted on June 27, 2007 at 02:57

USB Library : how to make ControlOut with data ?

2 REPLIES 2
shangdawei1
Associate II
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 ]

shangdawei1
Associate II
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 */