提交 c444c5d3 编写于 作者: T THEWON 提交者: Gitee

update bsp/stm32/libraries/HAL_Drivers/drv_usbh.c.

修改了 hcd 初始化函数。删掉 RT_ASSERT 宏调用函数的操作方法。防止因禁用调试 RT_ASSERT 定义为空,导致 HAL_HCD_Init 不被编译的情况出现。
上级 45b540d3
......@@ -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.
先完成此消息的编辑!
想要评论请 注册