Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBDevice by
Revision 72:e5c300b1df2f, committed 2018-05-11
- Comitter:
- Patrickhalahan
- Date:
- Fri May 11 09:07:29 2018 +0000
- Parent:
- 71:53949e6131f6
- Commit message:
- Just enough to get SD card size to report
Changed in this revision
--- a/USBDevice/USBDevice.cpp	Thu Jul 27 12:14:04 2017 +0100
+++ b/USBDevice/USBDevice.cpp	Fri May 11 09:07:29 2018 +0000
@@ -719,13 +719,15 @@
 
 bool USBDevice::configured(void)
 {
+//device.state = CONFIGURED; // debug BL
     /* Returns true if device is in the CONFIGURED state */
     return (device.state == CONFIGURED);
 }
 
 void USBDevice::connect(bool blocking)
 {
-    /* Connect device */
+printf("USBDevice::connect,  %s : %d\r\n", __FILE__, __LINE__);
+     /* Connect device */
     USBHAL::connect();
 
     if (blocking) {
@@ -818,7 +820,13 @@
 
 
 USBDevice::USBDevice(uint16_t vendor_id, uint16_t product_id, uint16_t product_release){
-    VENDOR_ID = vendor_id;
+
+
+extern int  USBDeviceInstCount; // debug BL
+++USBDeviceInstCount;  // debug BL
+
+
+   VENDOR_ID = vendor_id;
     PRODUCT_ID = product_id;
     PRODUCT_RELEASE = product_release;
 
@@ -838,15 +846,17 @@
 bool USBDevice::write(uint8_t endpoint, uint8_t * buffer, uint32_t size, uint32_t maxSize)
 {
     EP_STATUS result;
-
+printf("USBDevice::write end pt: %d at %s : %d\r\n", endpoint, __FILE__, __LINE__);
     if (size > maxSize)
     {
+printf("USBDevice::write: return false 1\r\n");
         return false;
     }
 
 
     if(!configured()) {
-        return false;
+ printf("USBDevice::write: return false 2\r\n");
+       return false;
     }
 
     /* Send report */
@@ -854,6 +864,7 @@
 
     if (result != EP_PENDING)
     {
+printf("USBDevice::write: return false 3\r\n");
         return false;
     }
 
--- a/USBHID/USBHID.cpp	Thu Jul 27 12:14:04 2017 +0100
+++ b/USBHID/USBHID.cpp	Fri May 11 09:07:29 2018 +0000
@@ -23,6 +23,12 @@
 
 USBHID::USBHID(uint8_t output_report_length, uint8_t input_report_length, uint16_t vendor_id, uint16_t product_id, uint16_t product_release, bool connect): USBDevice(vendor_id, product_id, product_release)
 {
+
+
+extern int  USBHID_USBHIDInstCount; // debug BL
+++USBHID_USBHIDInstCount; // debug BL
+
+
     output_length = output_report_length;
     input_length = input_report_length;
     if(connect) {
@@ -33,6 +39,7 @@
 
 bool USBHID::send(HID_REPORT *report)
 {
+printf("USBHID::send %s : %d\r\n", __FILE__, __LINE__);
     return write(EPINT_IN, report->data, report->length, MAX_HID_REPORT_SIZE);
 }
 
--- a/USBMSD/USBMSD.cpp	Thu Jul 27 12:14:04 2017 +0100
+++ b/USBMSD/USBMSD.cpp	Fri May 11 09:07:29 2018 +0000
@@ -64,6 +64,12 @@
 
 
 USBMSD::USBMSD(uint16_t vendor_id, uint16_t product_id, uint16_t product_release): USBDevice(vendor_id, product_id, product_release) {
+
+
+extern int USBMSD_USBMSD_InstCount;  // debug BL
+++USBMSD_USBMSD_InstCount;  // debug BL
+
+
     stage = READ_CBW;
     memset((void *)&cbw, 0, sizeof(CBW));
     memset((void *)&csw, 0, sizeof(CSW));
@@ -104,6 +110,7 @@
 
 
 bool USBMSD::connect(bool blocking) {
+printf("USBMSD::connect\r\n");
     //disk initialization
     if (disk_status() & NO_INIT) {
         if (disk_initialize()) {
    