comparison Output/pjrcUSB/arm/usb_dev.c @ 309:4f47971c45c2

Merge remote-tracking branch 'upstream/master'
author Rowan Decker <Smasher816@gmail.com>
date Sun, 08 Mar 2015 20:17:39 -0700
parents ab4515606277 ac842066568a
children f7b14e25ca5b
comparison
equal deleted inserted replaced
308:ab4515606277 309:4f47971c45c2
298 reply_buffer[1] = 0; 298 reply_buffer[1] = 0;
299 datalen = 2; 299 datalen = 2;
300 data = reply_buffer; 300 data = reply_buffer;
301 break; 301 break;
302 case 0x0082: // GET_STATUS (endpoint) 302 case 0x0082: // GET_STATUS (endpoint)
303 if (setup.wIndex > NUM_ENDPOINTS) 303 if ( setup.wIndex > NUM_ENDPOINTS )
304 { 304 {
305 // TODO: do we need to handle IN vs OUT here? 305 // TODO: do we need to handle IN vs OUT here?
306 endpoint0_stall(); 306 endpoint0_stall();
307 return; 307 return;
308 } 308 }
311 if ( *(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4) & 0x02 ) 311 if ( *(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4) & 0x02 )
312 reply_buffer[0] = 1; 312 reply_buffer[0] = 1;
313 data = reply_buffer; 313 data = reply_buffer;
314 datalen = 2; 314 datalen = 2;
315 break; 315 break;
316 case 0x0102: // CLEAR_FEATURE (endpoint) 316 case 0x0100: // CLEAR_FEATURE (device)
317 case 0x0101: // CLEAR_FEATURE (interface)
318 // TODO: Currently ignoring, perhaps useful? -HaaTa
319 endpoint0_stall();
320 return;
321 case 0x0102: // CLEAR_FEATURE (interface)
317 i = setup.wIndex & 0x7F; 322 i = setup.wIndex & 0x7F;
318 if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) 323 if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
319 { 324 {
320 // TODO: do we need to handle IN vs OUT here?
321 endpoint0_stall(); 325 endpoint0_stall();
322 return; 326 return;
323 } 327 }
324 (*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02; 328 //(*(uint8_t *)(&USB0_ENDPT0 + setup.wIndex * 4)) &= ~0x02;
325 // TODO: do we need to clear the data toggle here? 329 // TODO: do we need to clear the data toggle here?
326 break; 330 //break;
331
332 // FIXME: Clearing causes keyboard to freeze, likely an invalid clear
333 // XXX: Ignoring seems to work, though this may not be the ideal behaviour -HaaTa
334 endpoint0_stall();
335 return;
336 case 0x0300: // SET_FEATURE (device)
337 case 0x0301: // SET_FEATURE (interface)
338 // TODO: Currently ignoring, perhaps useful? -HaaTa
339 endpoint0_stall();
340 return;
327 case 0x0302: // SET_FEATURE (endpoint) 341 case 0x0302: // SET_FEATURE (endpoint)
328 i = setup.wIndex & 0x7F; 342 i = setup.wIndex & 0x7F;
329 if ( i > NUM_ENDPOINTS || setup.wValue != 0 ) 343 if ( i > NUM_ENDPOINTS || setup.wValue != 0 )
330 { 344 {
331 // TODO: do we need to handle IN vs OUT here? 345 // TODO: do we need to handle IN vs OUT here?