/* Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration of the USB device after enumeration, and configures the keyboard device endpoints.  */
void EVENT_USB_Device_ConfigurationChanged(void)
/* Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration of the USB device after enumeration, and configures the keyboard device endpoints.  */
void EVENT_USB_Device_ConfigurationChanged(void)
{
	bool ConfigSuccess = true;
	ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1);
	ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1);
	USB_Device_EnableSOFEvents();
	LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
}