提交 03837384 编写于 作者: B bernard 提交者: Gitee

!224 修改 stm32 驱动库 usbh 初始化错误

Merge pull request !224 from THEWON/usbh_init
......@@ -197,6 +197,8 @@ static struct uhcd_ops _uhcd_ops =
static rt_err_t stm32_hcd_init(rt_device_t device)
{
HAL_StatusTypeDef state;
HCD_HandleTypeDef *hhcd = (HCD_HandleTypeDef *)device->user_data;
hhcd->Instance = USB_OTG_FS;
hhcd->Init.Host_channels = 8;
......@@ -204,7 +206,11 @@ static rt_err_t stm32_hcd_init(rt_device_t device)
hhcd->Init.dma_enable = DISABLE;
hhcd->Init.phy_itface = HCD_PHY_EMBEDDED;
hhcd->Init.Sof_enable = DISABLE;
RT_ASSERT(HAL_HCD_Init(hhcd) == HAL_OK);
state = HAL_HCD_Init(hhcd);
if (state != HAL_OK)
{
return -RT_ERROR;
}
HAL_HCD_Start(hhcd);
#ifdef USBH_USING_CONTROLLABLE_POWER
rt_pin_mode(USBH_POWER_PIN, PIN_MODE_OUTPUT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册