我想通过usb建立tablet与stm32之间的通信,为此我在代码中添加了usb库。在代码中添加库我得到了这个错误。错误[Pe167]:类型为“uint16_t *”的参数与类型为“unsigned char *”的参数不兼容
错误[Pe167]:类型的参数“uint16_t *”是类型为“无符号字符*”
我使用的参数不兼容的IAR Embedded Workbench EWARM工具STM32 coding.Error上的回报正在添加行功能如下所示。
static USBH_Status USBH_ADK_getProtocol (USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)
{
phost->Control.setup.b.bmRequestType = USB_D2H | USB_REQ_TYPE_VENDOR | USB_REQ_RECIPIENT_DEVICE;
phost->Control.setup.b.bRequest = ACCESSORY_GET_PROTOCOL;
phost->Control.setup.b.wValue.w = 0;
phost->Control.setup.b.wIndex.w = 0;
phost->Control.setup.b.wLength.w = 2;
abc= ADK_Machine.protocol;
/* Control Request */
return USBH_CtlReq(pdev, phost, &ADK_Machine.protocol , 2);
}
而且功能USBH_CtlReq是
USBH_Status USBH_CtlReq (USB_OTG_CORE_HANDLE *pdev,
USBH_HOST *phost,
uint8_t *buff,
uint16_t length)
{
USBH_Status status;
status = USBH_BUSY;
switch (phost->RequestState)
{
case CMD_SEND:
/* Start a SETUP transfer */
USBH_SubmitSetupRequest(phost, buff, length);
phost->RequestState = CMD_WAIT;
status = USBH_BUSY;
break;
case CMD_WAIT:
if (phost->Control.state == CTRL_COMPLETE)
{
/* Commands successfully sent and Response Received */
phost->RequestState = CMD_SEND;
phost->Control.state =CTRL_IDLE;
status = USBH_OK;
}
else if (phost->Control.state == CTRL_ERROR)
{
/* Failure Mode */
phost->RequestState = CMD_SEND;
status = USBH_FAIL;
}
else if (phost->Control.state == CTRL_STALLED)
{
/* Commands successfully sent and Response Received */
phost->RequestState = CMD_SEND;
status = USBH_NOT_SUPPORTED;
}
break;
default:
break;
}
return status;
}
任何一个可以请帮我在提前解决这个problem.Thanks。
+0
您已将此标签标记为[tag:c#],但它看起来不像c#。这是C++还是c,还是别的?请参阅[什么是标签,以及如何使用它们?](https://stackoverflow.com/help/tagging)以获取有关如何标记的建议。 –
+0
我对使用正确的标签采取了我最好的猜测。如有必要,请[编辑标签](http://meta.stackexchange.com/questions/37672/when-should-you-edit-tags)改进。 –
+1
请选择正确的语言,而不是多种语言。此外,提供一个最小但完整的例子,你的问题因为它被认为是脱离主题。 –