晶振是25mhz的,问题是 为什么接u盘能识别已经连接并且可以枚举(但因为是hid的host程序,枚举到hid class当然就停掉了),而接键盘却连连接都无法识别,老是跳到这里error state:
【
case HOST_ERROR_STATE:
/* Re-Initilaize Host for new Enumeration */
USBH_DeInit(pdev, phost);
phost->usr_cb->DeInit();
phost->class_cb->DeInit(pdev, &phost->device_prop);
break;
】
调试发现是经过以下判断后跳到上面的err的
【
/* check for Host port events */
if ((HCD_IsDeviceConnected(pdev) == 0)&& (phost->gState != HOST_IDLE))
{
if(phost->gState != HOST_DEV_DISCONNECTED)
{
phost->gState = HOST_DEV_DISCONNECTED;
}
}
switch (phost->gState) //-------------------------》就跳到了error state:
】
这到底是为什么啊!!求版主赐教!~ |