summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-05 20:16:30 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-11 13:31:47 +0200
commit6d9ee8e9a63208e83adddfe1eeccf7461297dc1b (patch)
tree87f94ede14bc8e95c912f649f5386b283f0a69db
parent58fec7a17ceb6814d64e702e7829556c3ece01e4 (diff)
downloadsecure-hid-6d9ee8e9a63208e83adddfe1eeccf7461297dc1b.tar.gz
secure-hid-6d9ee8e9a63208e83adddfe1eeccf7461297dc1b.tar.bz2
secure-hid-6d9ee8e9a63208e83adddfe1eeccf7461297dc1b.zip
add DISABLE_LOW_LEVEL ifdef in hub device driver
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
-rw-r--r--src/usbh_driver_hub.c8
1 files changed, 8 insertions, 0 deletions
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;