]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Adding additional case statements for SET_FEATURE and CLEAR_FEATURE
authorJacob Alexander <haata@kiibohd.com>
Sat, 7 Mar 2015 08:50:42 +0000 (00:50 -0800)
committerJacob Alexander <haata@kiibohd.com>
Sat, 7 Mar 2015 08:50:42 +0000 (00:50 -0800)
- Ignoring (which is done by default)
- Device, Interface and Endpoint variants

Output/pjrcUSB/arm/usb_dev.c

index 18e51b620ef3b9248474d53745a36c7b31253aca..138d2c258d5acea68336a8b7c4ea5ca3b4058e38 100644 (file)
@@ -300,7 +300,7 @@ static void usb_setup()
                data = reply_buffer;
                break;
        case 0x0082: // GET_STATUS (endpoint)
-               if (setup.wIndex > NUM_ENDPOINTS)
+               if ( setup.wIndex > NUM_ENDPOINTS )
                {
                        // TODO: do we need to handle IN vs OUT here?
                        endpoint0_stall();
@@ -313,7 +313,12 @@ static void usb_setup()
                data = reply_buffer;
                datalen = 2;
                break;
-       case 0x0102: // CLEAR_FEATURE (endpoint)
+       case 0x0100: // CLEAR_FEATURE (device)
+       case 0x0101: // CLEAR_FEATURE (interface)
+               // TODO: Currently ignoring, perhaps useful? -HaaTa
+               endpoint0_stall();
+               return;
+       case 0x0102: // CLEAR_FEATURE (interface)
                i = setup.wIndex & 0x7F;
                if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
                {
@@ -328,6 +333,11 @@ static void usb_setup()
                // XXX: Ignoring seems to work, though this may not be the ideal behaviour -HaaTa
                endpoint0_stall();
                return;
+       case 0x0300: // SET_FEATURE (device)
+       case 0x0301: // SET_FEATURE (interface)
+               // TODO: Currently ignoring, perhaps useful? -HaaTa
+               endpoint0_stall();
+               return;
        case 0x0302: // SET_FEATURE (endpoint)
                i = setup.wIndex & 0x7F;
                if ( i > NUM_ENDPOINTS || setup.wValue != 0 )