描述符長(zhǎng)度這里會(huì)返回錯(cuò)誤,代碼是從ch554移植過(guò)來(lái)的,ch554使用正常,到了CH549就不行了,請(qǐng)問(wèn)為啥?
UINT8???CtrlGetDeviceDescr(?void?)?? { ????UINT8???s; ????UINT8???len; ????UsbDevEndp0Size?=?DEFAULT_ENDP0_SIZE; ????CopySetupReqPkg(?SetupGetDevDescr?); ????s?=?HostCtrlTransfer(?Com_Buffer,?(PUINT8)&len?);????????????????????????????//?執(zhí)行控制傳輸 if?(?s?!=?ERR_SUCCESS?) ????{ ????????return(?s?); ????} ????UsbDevEndp0Size?=?(?(PXUSB_DEV_DESCR)Com_Buffer?)?->?bMaxPacketSize0;????????//?端點(diǎn)0最大包長(zhǎng)度,這是簡(jiǎn)化處理,正常應(yīng)該先獲取前8字節(jié)后立即更新UsbDevEndp0Size再繼續(xù) ????if?(?len?<?(?(PUSB_SETUP_REQ)SetupGetDevDescr?)?->?wLengthL?) ????{ ????????printf("SetupGetDevDescr?ERR_USB_BUF_OVER\n\r"?); ????????return(?ERR_USB_BUF_OVER?);?////////?在這里返回錯(cuò)誤???????????????????????????????????//?描述符長(zhǎng)度錯(cuò)誤 ????} ????return(?ERR_SUCCESS?); }
熱門產(chǎn)品 :
CH394: 以太網(wǎng)協(xié)議棧芯片