2007-06-26 05:57 PM
USB Library : how to make ControlOut with data ?
2007-03-25 07:36 PM
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 ]2007-06-26 05:57 PM
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 */