From dac0c88362f2adf7ea596902e8a96741b9e65ec3 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 29 Nov 2023 17:58:34 +0100 Subject: [PATCH] Fixes. --- config.h | 6 +++++- midi_devices.hpp | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 066b980..2695d35 100644 --- a/config.h +++ b/config.h @@ -71,7 +71,7 @@ //************************************************************************************************* #define MIDI_DEVICE_DIN Serial1 #define MIDI_DEVICE_USB 1 -#define MIDI_DEVICE_USB_HOST 1 +//#define MIDI_DEVICE_USB_HOST 1 #define MIDI_DEVICE_USB_HOST_SERIAL 1 #ifdef MIDI_DEVICE_USB_HOST_SERIAL @@ -80,6 +80,10 @@ #define USB_HOST_SERIAL_FORMAT USBHOST_SERIAL_8N1 #endif +#if defined(MIDI_DEVICE_USB_HOST) && defined(MIDI_DEVICE_USB_HOST_SERIAL) +#error Enabling MIDI_DEVICE_USB_HOST and MIDI_DEVICE_USB_HOST_SERIAL at the same time is not allowed! +#endif + //************************************************************************************************* //* AUDIO HARDWARE SETTINGS //************************************************************************************************* diff --git a/midi_devices.hpp b/midi_devices.hpp index 48184df..c8ccda4 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -1080,8 +1080,11 @@ FLASHMEM void setup_midi_devices(void) { #endif #ifdef MIDI_DEVICE_USB_HOST_SERIAL + Serial.println("1"); usb_host.begin(); + Serial.println("2"); userial.begin(USB_HOST_SERIAL_BAUD, USB_HOST_SERIAL_FORMAT); + Serial.println("3"); usbhost_midi_serial.setHandleNoteOn(handleNoteOn_MIDI_DEVICE_USB_HOST_SERIAL); usbhost_midi_serial.setHandleNoteOff(handleNoteOff_MIDI_DEVICE_USB_HOST_SERIAL); usbhost_midi_serial.setHandleControlChange(handleControlChange_MIDI_DEVICE_USB_HOST_SERIAL); @@ -1101,7 +1104,7 @@ FLASHMEM void setup_midi_devices(void) { 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); - + Serial.println("4"); usbhost_midi_serial.begin(DEFAULT_MIDI_CHANNEL); #ifdef DEBUG