Fix USB MIDI enumeration: switch from ARDUINO_USB_MODE=1 to 0 (matches working Adafruit TinyUSB example), add explicit TinyUSBDevice.begin(0) and detach/attach re-enumeration, remove conflicting tusb_config.h
This commit is contained in:
+11
-1
@@ -13,15 +13,25 @@ UsbMidiTransport::~UsbMidiTransport() {
|
||||
bool UsbMidiTransport::begin() {
|
||||
Serial.println("[MIDI] Setting up USB MIDI device...");
|
||||
|
||||
if (!TinyUSBDevice.isInitialized()) {
|
||||
TinyUSBDevice.begin(0);
|
||||
}
|
||||
|
||||
TinyUSBDevice.setManufacturerDescriptor("Ashley Strahle");
|
||||
TinyUSBDevice.setProductDescriptor("Loopy Foot Controller");
|
||||
TinyUSBDevice.setSerialDescriptor("LFMIDI001");
|
||||
|
||||
if (!usb_midi.begin(32)) {
|
||||
if (!usb_midi.begin()) {
|
||||
Serial.println("[MIDI] ERROR: USB MIDI init failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TinyUSBDevice.mounted()) {
|
||||
TinyUSBDevice.detach();
|
||||
delay(10);
|
||||
TinyUSBDevice.attach();
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
Serial.println("[MIDI] USB MIDI ready - enumerating...");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user