Browse Source

Wait for phantom Connect interrupts to finish before completing

Disconnect processing

Conflicts:
	Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c
USG_1.0
Robert Fisk 2 years ago
parent
commit
828db8e415
  1. 16
      Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c

16
Downstream/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c

@ -53,6 +53,10 @@
#define USBH_ADDRESS_DEFAULT 0
#define USBH_ADDRESS_ASSIGNED 1
#define USBH_MPS_DEFAULT 0x40
#define USBH_ATTACH_DELAY_MS 200
#define USBH_DETACH_DELAY_MS 500
/**
* @}
*/
@ -410,9 +414,9 @@ USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
if (phost->device.is_connected)
{
/* Wait for 200 ms after connection */
/* Wait for 200 ms after connection */
phost->gState = HOST_DEV_WAIT_FOR_ATTACHMENT;
USBH_Delay(200);
USBH_Delay(USBH_ATTACH_DELAY_MS);
USBH_LL_ResetPort(phost);
#if (USBH_USE_OS == 1)
osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
@ -586,9 +590,9 @@ USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
phost->pActiveClass->BgndProcess(phost);
}
break;
case HOST_DEV_DISCONNECTED :
case HOST_DEV_DISCONNECTED:
USBH_Delay(USBH_DETACH_DELAY_MS);
DeInitStateMachine(phost);
/* Re-Initilaize Host for new Enumeration */
@ -596,7 +600,7 @@ USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
{
phost->pActiveClass->DeInit(phost);
phost->pActiveClass = NULL;
}
}
break;
case HOST_ABORT_STATE:

Loading…
Cancel
Save