Mercurial > louis > kiibohd-controller
changeset 302:ac842066568a
Adding additional case statements for SET_FEATURE and CLEAR_FEATURE
- Ignoring (which is done by default)
- Device, Interface and Endpoint variants
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sat, 07 Mar 2015 00:50:42 -0800 |
parents | c8605539efef |
children | f158dfa0fa85 |
files | Output/pjrcUSB/arm/usb_dev.c |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Output/pjrcUSB/arm/usb_dev.c Sat Mar 07 00:34:14 2015 -0800 +++ b/Output/pjrcUSB/arm/usb_dev.c Sat Mar 07 00:50:42 2015 -0800 @@ -300,7 +300,7 @@ 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 @@ 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 @@ // 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 )