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:
2026-06-23 23:10:20 +00:00
parent d957e276bd
commit a3e86d0ddf
4 changed files with 21 additions and 24 deletions
+11 -1
View File
@@ -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;