Error status LEDs shown when device endpoint configuration fails to complete.

MIDI device demo no longer blocks if a note change event is sent while the endpoint is not ready.
This commit is contained in:
Dean Camera 2009-06-08 07:46:07 +00:00
parent ac70ddd0a1
commit e6881fd166
14 changed files with 235 additions and 143 deletions

View file

@ -100,23 +100,32 @@ void EVENT_USB_Disconnect(void)
*/
void EVENT_USB_ConfigurationChanged(void)
{
/* Setup Keyboard Report Endpoint */
Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HID_EPSIZE,
ENDPOINT_BANK_SINGLE);
/* Setup Keyboard LED Report Endpoint */
Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_OUT, HID_EPSIZE,
ENDPOINT_BANK_SINGLE);
/* Setup Mouse Report Endpoint */
Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HID_EPSIZE,
ENDPOINT_BANK_SINGLE);
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
/* Setup Keyboard Report Endpoint */
if (!(Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HID_EPSIZE,
ENDPOINT_BANK_SINGLE)))
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/* Setup Keyboard LED Report Endpoint */
if (!(Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_OUT, HID_EPSIZE,
ENDPOINT_BANK_SINGLE)))
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/* Setup Mouse Report Endpoint */
if (!(Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT,
ENDPOINT_DIR_IN, HID_EPSIZE,
ENDPOINT_BANK_SINGLE)))
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
}
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific