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 5 years ago
parent 0b75f7d1c6
commit 828db8e415

@ -53,6 +53,10 @@
#define USBH_ADDRESS_DEFAULT 0 #define USBH_ADDRESS_DEFAULT 0
#define USBH_ADDRESS_ASSIGNED 1 #define USBH_ADDRESS_ASSIGNED 1
#define USBH_MPS_DEFAULT 0x40 #define USBH_MPS_DEFAULT 0x40
#define USBH_ATTACH_DELAY_MS 200
#define USBH_DETACH_DELAY_MS 500
/** /**
* @} * @}
*/ */
@ -412,7 +416,7 @@ USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
{ {
/* Wait for 200 ms after connection */ /* Wait for 200 ms after connection */
phost->gState = HOST_DEV_WAIT_FOR_ATTACHMENT; phost->gState = HOST_DEV_WAIT_FOR_ATTACHMENT;
USBH_Delay(200); USBH_Delay(USBH_ATTACH_DELAY_MS);
USBH_LL_ResetPort(phost); USBH_LL_ResetPort(phost);
#if (USBH_USE_OS == 1) #if (USBH_USE_OS == 1)
osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0); osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
@ -588,7 +592,7 @@ USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
break; break;
case HOST_DEV_DISCONNECTED: case HOST_DEV_DISCONNECTED:
USBH_Delay(USBH_DETACH_DELAY_MS);
DeInitStateMachine(phost); DeInitStateMachine(phost);
/* Re-Initilaize Host for new Enumeration */ /* Re-Initilaize Host for new Enumeration */

Loading…
Cancel
Save