uint8_t In0_Process(void)
{
uint32_t ControlState = pInformation->ControlState;
if((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))
{
DataStageIn();
/* ControlState may be changed outside the function */
ControlState = pInformation->ControlState;
}
else if(ControlState == WAIT_STATUS_IN)
{
//为什么在这里处理SET_ADDRESS这个请求呢??????????????
if((pInformation->USBbRequest == SET_ADDRESS) &&
(Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)))
{
SetDeviceAddress(pInformation->USBwValue0);
pUser_Standard_Requests->User_SetDeviceAddress();
}
(*pProperty->Process_Status_IN)();
ControlState = STALLED;
}
else
{
ControlState = STALLED;
}
pInformation->ControlState = ControlState;
return Post0_Process();
}
香主,SET_ADDRESS这个标准请求不是应该在Setup0_Process()函数里面实现的吗?晕了。。。 |