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:
55:e47a4b7ab348
Parent:
53:02408ec83097
Child:
68:edfecf67a931
--- a/USBDevice/USBHID/USBHID.cpp	Thu Feb 11 19:08:37 2016 +0000
+++ b/USBDevice/USBHID/USBHID.cpp	Thu Feb 11 19:14:12 2016 +0000
@@ -146,6 +146,23 @@
     {
         switch (transfer->setup.bRequest)
         {
+            case GET_REPORT:
+                // not implemented
+                break;
+                
+            case GET_IDLE:
+                // 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;
+                break;
+                
+            case GET_PROTOCOL:
+                // not implemented
+                break;
+                
              case SET_REPORT:
                 // First byte will be used for report ID
                 outputReport.data[0] = transfer->setup.wValue & 0xff;
@@ -156,6 +173,23 @@
                 transfer->direction = HOST_TO_DEVICE;
                 transfer->notify = true;
                 success = true;
+                break;
+
+            case SET_IDLE:
+                // 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;
+                
+            case SET_PROTOCOL:
+                // not implemented
+                break;
+                                
             default:
                 break;
         }