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
+7
View File
@@ -82,6 +82,12 @@ void handle_serial_command(const String& cmd) {
mux.set_led_color(1, 255, 255, 255);
mux.show();
Serial.println("[CMD] Pixel 1 WHITE (max brightness)");
} else if (cmd == "usb") {
Serial.printf("[CMD] USB mounted: %s\n", TinyUSBDevice.mounted() ? "YES" : "NO");
Serial.printf("[CMD] USB VID:PID = 0x%04X:0x%04X\n", TinyUSBDevice.vid(), TinyUSBDevice.pid());
Serial.printf("[CMD] USB manufacturer: %s\n", TinyUSBDevice.manufacturerDescriptor());
Serial.printf("[CMD] USB product: %s\n", TinyUSBDevice.productDescriptor());
Serial.printf("[CMD] USB serial: %s\n", TinyUSBDevice.serialDescriptor());
} else if (cmd == "gpiotest") {
Serial.println("[CMD] === Raw GPIO Test ===");
uint8_t pins[] = {9, 10, 11, 12};
@@ -122,6 +128,7 @@ void handle_serial_command(const String& cmd) {
Serial.println(" read - raw button read");
Serial.println(" red/green/blue - solid colour");
Serial.println(" pixel0/pixel1 - single pixel test");
Serial.println(" usb - USB connection status and descriptor info");
Serial.println(" gpiotest - raw GPIO pin diagnostic");
Serial.println(" rawled - bit-bang WS2812 (no library)");
Serial.println(" anim - re-run startup animation from loop");