Again some additions for USB-Host-Serial handling.

dev
Holger Wirtz 1 year ago
parent 48a22e0c42
commit 4895c23678
  1. 5
      config.h
  2. 5
      midi_devices.hpp

@ -60,7 +60,7 @@
// //
// Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html // Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html
#define VERSION "1.2.9" #define VERSION "1.2.10"
//************************************************************************************************* //*************************************************************************************************
//* DEVICE SETTINGS //* DEVICE SETTINGS
@ -71,10 +71,11 @@
//************************************************************************************************* //*************************************************************************************************
#define MIDI_DEVICE_DIN Serial1 #define MIDI_DEVICE_DIN Serial1
#define MIDI_DEVICE_USB 1 #define MIDI_DEVICE_USB 1
//#define MIDI_DEVICE_USB_HOST 1 #define MIDI_DEVICE_USB_HOST 1
#define MIDI_DEVICE_USB_HOST_SERIAL 1 #define MIDI_DEVICE_USB_HOST_SERIAL 1
#ifdef MIDI_DEVICE_USB_HOST_SERIAL #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_BAUD 38400
#define USB_HOST_SERIAL_FORMAT USBHOST_SERIAL_8N1 #define USB_HOST_SERIAL_FORMAT USBHOST_SERIAL_8N1
#endif #endif

@ -58,10 +58,15 @@ USBHost usb_host;
MIDIDevice midi_usb(usb_host); MIDIDevice midi_usb(usb_host);
#endif #endif
#ifdef MIDI_DEVICE_USB_HOST_SERIAL #ifdef MIDI_DEVICE_USB_HOST_SERIAL
#if NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 2
USBHub hub1(usb_host); USBHub hub1(usb_host);
#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 3
USBHub hub2(usb_host); USBHub hub2(usb_host);
#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 4
USBHub hub3(usb_host); USBHub hub3(usb_host);
#elif NUM_HUBS_MIDI_DEVICE_USB_HOST_SERIAL < 5
USBHub hub4(usb_host); USBHub hub4(usb_host);
#endif
USBSerial_BigBuffer userial(usb_host,1); USBSerial_BigBuffer userial(usb_host,1);
MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings> serialMIDI(userial); MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings> serialMIDI(userial);
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>&)serialMIDI); MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>> usbhost_midi_serial((MIDI_NAMESPACE::SerialMIDI<USBSerial_BigBuffer, CustomBaudRateSettings>&)serialMIDI);

Loading…
Cancel
Save