comparison Output/pjrcUSB/arm/usb_dev.c @ 301:c8605539efef

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)
author Jacob Alexander <haata@kiibohd.com>
date Sat, 07 Mar 2015 00:34:14 -0800
parents d5bf41d7f7ef
children ac842066568a
comparison
equal deleted inserted replaced
300:7119c2149abb 301:c8605539efef
315 break; 315 break;
316 case 0x0102: // CLEAR_FEATURE (endpoint) 316 case 0x0102: // CLEAR_FEATURE (endpoint)
317 i = setup.wIndex & 0x7F; 317 i = setup.wIndex & 0x7F;
318 if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) 318 if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
319 { 319 {
320 // TODO: do we need to handle IN vs OUT here?
321 endpoint0_stall(); 320 endpoint0_stall();
322 return; 321 return;
323 } 322 }
324 (*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02; 323 //(*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02;
325 // TODO: do we need to clear the data toggle here? 324 // TODO: do we need to clear the data toggle here?
326 break; 325 //break;
326
327 // FIXME: Clearing causes keyboard to freeze, likely an invalid clear
328 // XXX: Ignoring seems to work, though this may not be the ideal behaviour -HaaTa
329 endpoint0_stall();
330 return;
327 case 0x0302: // SET_FEATURE (endpoint) 331 case 0x0302: // SET_FEATURE (endpoint)
328 i = setup.wIndex & 0x7F; 332 i = setup.wIndex & 0x7F;
329 if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) 333 if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
330 { 334 {
331 // TODO: do we need to handle IN vs OUT here? 335 // TODO: do we need to handle IN vs OUT here?