/** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { bool ConfigSuccess = true; ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&USB_MIDI_Interface); //set some LED? }
/** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { bool ConfigSuccess = true; ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&Keyboard_MIDI_Interface); LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); }
/* 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); }
// Device has enumerated. Set up the Endpoints. // void EVENT_USB_Device_ConfigurationChanged(void) { // Indicate that USB is now ready to use (followed by a short delay so // you can actually see it flash). led_set_state(0x0004); // Allow the LUFA MIDI Class drivers to configure the USB endpoints. if (!MIDI_Device_ConfigureEndpoints(g_midi_interface_info)) { // Setting up the endpoints failed, display the error state. led_set_state(0x0008); } // Success. Add a short delay so the final USB state LEDs can be seen // before the MIDI task takes over the LEDs. _delay_ms(40); led_set_state(0x0000); // Now we can enable the watchdog timer wdt_enable(WDTO_120MS); }
/** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { bool ConfigSuccess = true; ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&tbase8_MIDI_Interface); }
/** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { LEDs_SetAllLEDs(LEDMASK_USB_READY); if (!MIDI_Device_ConfigureEndpoints(&Keyboard_MIDI_Interface)) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); }