mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
加入USB反初始化
This commit is contained in:
@@ -59,6 +59,13 @@ void USER_USB_DEVICE_DeInit(void)
|
||||
{
|
||||
USBD_Stop(&hUsbDeviceFS);
|
||||
USBD_DeInit(&hUsbDeviceFS);
|
||||
__HAL_RCC_USB_OTG_FS_FORCE_RESET();
|
||||
HAL_Delay(10);
|
||||
__HAL_RCC_USB_OTG_FS_RELEASE_RESET();
|
||||
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
|
||||
HAL_PCD_MspDeInit(hUsbDeviceFS.pData);
|
||||
// 手动配置USB引脚为GPIO输出,强制拉低DP线以模拟拔出
|
||||
USER_USBD_LL_Simulate_Disconnect();
|
||||
}
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
Reference in New Issue
Block a user