From 6d9ee8e9a63208e83adddfe1eeccf7461297dc1b Mon Sep 17 00:00:00 2001
From: Amir Hammad <amir.hammad@hotmail.com>
Date: Mon, 5 Sep 2016 20:16:30 +0200
Subject: add DISABLE_LOW_LEVEL ifdef in hub device driver

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
---
 src/usbh_driver_hub.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/usbh_driver_hub.c b/src/usbh_driver_hub.c
index 4fbe643..b1b37e5 100644
--- a/src/usbh_driver_hub.c
+++ b/src/usbh_driver_hub.c
@@ -638,6 +638,8 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
 						}
 						if ((sts & (1<<(HUB_FEATURE_PORT_LOWSPEED))) &&
 							!(sts & (1<<(HUB_FEATURE_PORT_HIGHSPEED)))) {
+#define DISABLE_LOW_SPEED
+#ifdef DISABLE_LOW_SPEED
 							LOG_PRINTF("Low speed device");
 
 							// Disable Low speed device immediately
@@ -655,6 +657,12 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
 
 							hub->current_port = CURRENT_PORT_NONE;
 							device_xfer_control_write_setup(&setup_data, sizeof(setup_data), event, dev);
+#else
+							hub->device[port]->speed = USBH_SPEED_LOW;
+							LOG_PRINTF("Low speed device");
+							hub->timestamp_us = hub->time_curr_us;
+							hub->state = 100; // schedule wait for 500ms
+#endif
 						} else if (!(sts & (1<<(HUB_FEATURE_PORT_LOWSPEED))) &&
 							!(sts & (1<<(HUB_FEATURE_PORT_HIGHSPEED)))) {
 							hub->device[port]->speed = USBH_SPEED_FULL;
-- 
cgit