Selaa lähdekoodia

Fixing Mac OSX freeze on wake-up bug

- CLEAR_FEATURE unset is currently causing the keyboarod to freeze
- Though not ideal, it seems harmless to ignore this USB Control Packet
- Tested working on a Mac Mini (Yosemite)
simple
Jacob Alexander 9 vuotta sitten
vanhempi
commit
b2dfd63d4b
1 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 7
    3
      Output/pjrcUSB/arm/usb_dev.c

+ 7
- 3
Output/pjrcUSB/arm/usb_dev.c Näytä tiedosto

i = setup.wIndex & 0x7F; i = setup.wIndex & 0x7F;
if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
{ {
// TODO: do we need to handle IN vs OUT here?
endpoint0_stall(); endpoint0_stall();
return; return;
} }
(*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02;
//(*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02;
// TODO: do we need to clear the data toggle here? // TODO: do we need to clear the data toggle here?
break;
//break;

// FIXME: Clearing causes keyboard to freeze, likely an invalid clear
// XXX: Ignoring seems to work, though this may not be the ideal behaviour -HaaTa
endpoint0_stall();
return;
case 0x0302: // SET_FEATURE (endpoint) case 0x0302: // SET_FEATURE (endpoint)
i = setup.wIndex & 0x7F; i = setup.wIndex & 0x7F;
if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) if ( i > NUM_ENDPOINTS || setup.wValue != 0 )