diff --git a/config.h b/config.h index 1ad9efa..7c28905 100644 --- a/config.h +++ b/config.h @@ -60,7 +60,7 @@ // // Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html -#define VERSION "1.2.9" +#define VERSION "1.2.10" //************************************************************************************************* //* DEVICE SETTINGS @@ -71,10 +71,11 @@ //************************************************************************************************* #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 +#define NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL 4 // 0..4 - needed, if you want to connect a USB-HUB wit hup to 4 devices to the USB-HOST port #define USB_HOST_SERIAL_BAUD 38400 #define USB_HOST_SERIAL_FORMAT USBHOST_SERIAL_8N1 #endif diff --git a/midi_devices.hpp b/midi_devices.hpp index 70cd2c9..18a327f 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -58,10 +58,15 @@ USBHost usb_host; MIDIDevice midi_usb(usb_host); #endif #ifdef MIDI_DEVICE_USB_HOST_SERIAL +#if NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 2 USBHub hub1(usb_host); +#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 3 USBHub hub2(usb_host); +#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 4 USBHub hub3(usb_host); +#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 5 USBHub hub4(usb_host); +#endif USBSerial_BigBuffer userial(usb_host,1); MIDI_NAMESPACE::SerialMIDI serialMIDI(userial); MIDI_NAMESPACE::MidiInterface> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI&)serialMIDI);