From 73abbcb75a7ab8a06682b27433a9388e8b74eaea Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 28 Nov 2023 15:41:57 +0100 Subject: [PATCH] Fix for showing vendor/product-id n debug output when device ist recognized at USB-Serial-Host. --- config.h | 4 ---- midi_devices.hpp | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/config.h b/config.h index 7c28905..066b980 100644 --- a/config.h +++ b/config.h @@ -80,10 +80,6 @@ #define USB_HOST_SERIAL_FORMAT USBHOST_SERIAL_8N1 #endif -/*#if defined(MIDI_DEVICE_USB_HOST) && defined(MIDI_DEVICE_USB_HOST_SERIAL) -#error Only MIDI_DEVICE_USB_HOST or MIDI_DEVICE_USB_HOST_SERIAL is possible to enable at the same time! -#endif */ - //************************************************************************************************* //* AUDIO HARDWARE SETTINGS //************************************************************************************************* diff --git a/midi_devices.hpp b/midi_devices.hpp index 18a327f..48184df 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -67,9 +67,9 @@ USBHub hub3(usb_host); #elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 5 USBHub hub4(usb_host); #endif -USBSerial_BigBuffer userial(usb_host,1); +USBSerial_BigBuffer userial(usb_host, 1); MIDI_NAMESPACE::SerialMIDI serialMIDI(userial); -MIDI_NAMESPACE::MidiInterface> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); +MIDI_NAMESPACE::MidiInterface> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI &)serialMIDI); #endif void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity); @@ -1100,12 +1100,20 @@ FLASHMEM void setup_midi_devices(void) { usbhost_midi_serial.setHandleStop(handleStop_MIDI_DEVICE_USB_HOST_SERIAL); usbhost_midi_serial.setHandleActiveSensing(handleActiveSensing_MIDI_DEVICE_USB_HOST_SERIAL); usbhost_midi_serial.setHandleSystemReset(handleSystemReset_MIDI_DEVICE_USB_HOST_SERIAL); -//usbhost_midi_serial.setHandleRealTimeSystem(handleRealTimeSystem_MIDI_DEVICE_USB_HOST_SERIAL); + //usbhost_midi_serial.setHandleRealTimeSystem(handleRealTimeSystem_MIDI_DEVICE_USB_HOST_SERIAL); - usbhost_midi_serial.begin(MIDI_CHANNEL_OMNI); + usbhost_midi_serial.begin(DEFAULT_MIDI_CHANNEL); #ifdef DEBUG - Serial.println(F("MIDI_DEVICE_USB_HOST_SERIAL enabled.")); + Serial.print(F("MIDI_DEVICE_USB_HOST_SERIAL enabled")); + if (userial.idVendor() > 0 && userial.idProduct() > 0) { + Serial.print(F("(0x")); + Serial.print(userial.idVendor()); + Serial.print(F("/0x")); + Serial.print(userial.idProduct()); + Serial.print(F(")")); + } + Serial.println(F(".")); #endif #endif