Pinscape Controller version 1 fork. This is a fork to allow for ongoing bug fixes to the original controller version, from before the major changes for the expansion board project.

Dependencies:   FastIO FastPWM SimpleDMA mbed

Fork of Pinscape_Controller by Mike R

Revision:
53:02408ec83097
Parent:
52:63f0a9b45f0c
Child:
55:e47a4b7ab348
--- a/USBDevice/USBHID/USBHID.cpp	Thu Feb 11 18:12:52 2016 +0000
+++ b/USBDevice/USBHID/USBHID.cpp	Thu Feb 11 18:31:05 2016 +0000
@@ -112,19 +112,16 @@
                             // multiple interfaces, this is used to identify which interface
                             // is being queried.  The base mbed implementation ignores this,
                             // which makes it impossible to implement multiple interfaces.
-                            int idx = DESCRIPTOR_INDEX(transfer->setup.wValue);
+                            int idx = transfer->setup.wIndex;
                             transfer->remaining = reportDescLengthN(idx);
                             transfer->ptr = reportDescN(idx);
                             transfer->direction = DEVICE_TO_HOST;
                             success = true;
                         }
                         break;
-                        
                     case HID_DESCRIPTOR:
-                        {
                             // Find the HID descriptor, after the configuration descriptor
-                            int idx = DESCRIPTOR_INDEX(transfer->setup.wValue);
-                            hidDescriptor = findDescriptor(HID_DESCRIPTOR, idx);
+                            hidDescriptor = findDescriptor(HID_DESCRIPTOR, transfer->setup.wIndex);
                             if (hidDescriptor != NULL)
                             {
                                 transfer->remaining = HID_DESCRIPTOR_LENGTH;
@@ -132,8 +129,7 @@
                                 transfer->direction = DEVICE_TO_HOST;
                                 success = true;
                             }
-                        }
-                        break;
+                            break;
 
                     default:
                         break;
@@ -150,26 +146,7 @@
     {
         switch (transfer->setup.bRequest)
         {
-            case GET_REPORT:
-                // not implemented
-                break;
-                
-            case GET_IDLE:
-#if 0 // $$$
-                // retrieve the idle rate from an interface
-                idleData = getIdleTime(transfer->setup.wIndex, LSB(transfer->setup.wValue));
-                transfer->ptr = &idleData;
-                transfer->remaining = 1;
-                transfer->direction = DEVICE_TO_HOST;
-                success = true;
-#endif // $$$
-                break;
-                
-            case GET_PROTOCOL:
-                // not implemented
-                break;
-                
-            case SET_REPORT:
+             case SET_REPORT:
                 // First byte will be used for report ID
                 outputReport.data[0] = transfer->setup.wValue & 0xff;
                 outputReport.length = transfer->setup.wLength + 1;
@@ -179,25 +156,6 @@
                 transfer->direction = HOST_TO_DEVICE;
                 transfer->notify = true;
                 success = true;
-                
-            case SET_IDLE:
-#if 0 // $$$
-                // Set idle time - time between INTERRUPT IN reports from the
-                // device when there are no changes to report.  setup.wIndex
-                // is the interface index (we're setting the idle time for the
-                // given interface only).  MSB(setup.wValue) gives the interval
-                // in 4ms units, with the special case that 0 means infinity.
-                setIdleTime(transfer->setup.wIndex, LSB(transfer->setup.wValue), MSB(transfer->setup.wValue));
-                transfer->remaining = 0;
-                transfer->direction = DEVICE_TO_HOST;
-                success = true;
-#endif // $$$
-                break;
-                
-            case SET_PROTOCOL:
-                // not implemented
-                break;
-                
             default:
                 break;
         }