From 89ff7d24ede1dd97b37d50083e0cf8076df056ee Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Tue, 8 May 2012 14:38:04 -0600 Subject: [PATCH] added delays in Get Config --- Usb.cpp | 2 +- examples/HID/USBHID_desc/USBHID_desc.pde | 2 +- hiduniversal.cpp | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Usb.cpp b/Usb.cpp index 3552e0a8..08e017c6 100644 --- a/Usb.cpp +++ b/Usb.cpp @@ -616,7 +616,7 @@ uint8_t USB::getConfDescr( uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser return ret; uint16_t total = ((USB_CONFIGURATION_DESCRIPTOR*)buf)->wTotalLength; - + delay(100); //USBTRACE2("\r\ntotal conf.size:", total); return( ctrlReq( addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, total, bufSize, buf, p )); diff --git a/examples/HID/USBHID_desc/USBHID_desc.pde b/examples/HID/USBHID_desc/USBHID_desc.pde index dee37da6..0870d077 100644 --- a/examples/HID/USBHID_desc/USBHID_desc.pde +++ b/examples/HID/USBHID_desc/USBHID_desc.pde @@ -58,7 +58,7 @@ Fail: } USB Usb; -USBHub Hub(&Usb); +//USBHub Hub(&Usb); HIDUniversal2 Hid(&Usb); UniversalReportParser Uni; diff --git a/hiduniversal.cpp b/hiduniversal.cpp index 5a56c0c5..a5d70143 100644 --- a/hiduniversal.cpp +++ b/hiduniversal.cpp @@ -127,6 +127,8 @@ uint8_t HIDUniversal::Init(uint8_t parent, uint8_t port, bool lowspeed) p->lowspeed = lowspeed; + //delay(200); + // Get device descriptor rcode = pUsb->getDevDescr( 0, 0, 8, (uint8_t*)buf ); @@ -176,6 +178,8 @@ uint8_t HIDUniversal::Init(uint8_t parent, uint8_t port, bool lowspeed) p->lowspeed = lowspeed; + delay(200); + if (len) rcode = pUsb->getDevDescr( bAddress, 0, len, (uint8_t*)buf ); @@ -194,6 +198,7 @@ uint8_t HIDUniversal::Init(uint8_t parent, uint8_t port, bool lowspeed) for (uint8_t i=0; i HexDump; ConfigDescParser confDescrParser(this);