Esempio n. 1
0
	/* Pull target /RESET line high */
	AVR_RESET_LINE_PORT |= AVR_RESET_LINE_MASK;
	AVR_RESET_LINE_DDR  |= AVR_RESET_LINE_MASK;
}


// Event handler for the library USB Connection event. */
void EVENT_USB_Device_Connect(void) {
	LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
}


// Event handler for the library USB Disconnection event. */
void EVENT_USB_Device_Disconnect(void) {
	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
}


// Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void) {

	bool ConfigSuccess = true;
	
	if (CURRENT_MODE == MODE_SERIAL) {
		RingBuffer_InitBuffer(&USBtoUSART_Buffer);
		RingBuffer_InitBuffer(&USARTtoUSB_Buffer);
		ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_Interface);
	}
	else {
		UCSR1B |= (1 << RXCIE1) | (1 << TXCIE1);
		ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&MIDI_Interface);
	}
	
	LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
	
}


// Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void) {
	
	if (CURRENT_MODE == MODE_SERIAL)
	  CDC_Device_ProcessControlRequest(&VirtualSerial_Interface);
	else 
	  MIDI_Device_ProcessControlRequest(&MIDI_Interface);
	
}
Esempio n. 2
0
/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
{
	MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);
}
Esempio n. 3
0
/** Event handler for the library USB Control Request reception event. */
void EVENT_USB_Device_ControlRequest(void)
{
  MIDI_Device_ProcessControlRequest(&tbase8_MIDI_Interface);
}
// Any other USB control command that we don't recognize is handled here.
//
void EVENT_USB_Device_UnhandledControlRequest(void)
{
    // Let the LUFA MIDI Class handle this request.
    MIDI_Device_ProcessControlRequest(g_midi_interface_info);
}