From b2dfd63d4b4ecbde73a7a33e0c0353d85ed50250 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Sat, 7 Mar 2015 00:34:14 -0800 Subject: [PATCH] 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) --- Output/pjrcUSB/arm/usb_dev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Output/pjrcUSB/arm/usb_dev.c b/Output/pjrcUSB/arm/usb_dev.c index c4c60b8..18e51b6 100644 --- a/Output/pjrcUSB/arm/usb_dev.c +++ b/Output/pjrcUSB/arm/usb_dev.c @@ -317,13 +317,17 @@ static void usb_setup() i = setup.wIndex & 0x7F; if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) { - // TODO: do we need to handle IN vs OUT here? endpoint0_stall(); 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? - 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) i = setup.wIndex & 0x7F; if ( i > NUM_ENDPOINTS || setup.wValue != 0 )