修正usb枚举失败的问题

master
ThinkPad-T460P 2020-04-14 17:28:14 +08:00
parent e467982901
commit 0196c26ad3
2 changed files with 7 additions and 1 deletions

View File

@ -1027,7 +1027,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)
#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
hpcd->SuspendCallback(hpcd); hpcd->SuspendCallback(hpcd);
#else #else
HAL_PCD_SuspendCallback(hpcd); //HAL_PCD_SuspendCallback(hpcd);
#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
} }
__HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_USBSUSP); __HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_USBSUSP);

View File

@ -1,2 +1,8 @@
# NaviKit_stm32 # NaviKit_stm32
导航套件源码STM32F107VCT6开发环境STM32CubeIDE 导航套件源码STM32F107VCT6开发环境STM32CubeIDE
# Note
在使用usb的时候
`stm32f1xx_hal_pcd.c文件内`
`void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)函数内`
`HAL_PCD_SuspendCallback(hpcd) 代码段` 务必屏蔽,否则导致枚举失败,提示获取设备描述符失败。