现在ST USB库还是变化蛮大,现在描述HID设备,发送OK, 接受不到PC的数据,估计是接受程序有问题:
USBD_HID_GetReport(&hUsbDeviceFS, GetHID_Buffer, 32);
uint8_t USBD_HID_GetReport (USBD_HandleTypeDef *pdev,
uint8_t *report,
uint16_t len)
{
//USBD_HID_HandleTypeDef *hhid = (USBD_HID_HandleTypeDef*)pdev->pClassData;
/*if (pdev->dev_state == USBD_STATE_CONFIGURED )
{
if(hhid->state == HID_IDLE)
{
hhid->state = HID_BUSY;
USBD_LL_PrepareReceive (pdev,
HID_EPOUT_ADDR,
report,
len);
}
}*/
USBD_LL_PrepareReceive (pdev,
HID_EPOUT_ADDR,
report,
len);
return USBD_OK;
}
这样不行,没有找到参考范例, 知道的朋友说一下。谢谢
|