From 1cac50dd5d1f9cb7dccee44a7086295e669cd5aa Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 13 Apr 2021 01:03:24 +0200 Subject: [PATCH] Update README --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df9a38b..c6bdc79 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ fn main() -> ! { let usb_bus = UsbBus::new(usb); - let mut midi = MidiClass::new(&usb_bus); + let mut midi = MidiClass::new(&usb_bus, 1, 1); let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x5e4)) .product("MIDI Test") @@ -68,4 +68,20 @@ fn main() -> ! { } } } -``` \ No newline at end of file +``` + +## Using more than one MIDI port + +Calling `MidiClass::new(&usb_bus, N, M);` with `N, M >= 1` to provide more +than one input or output port requires the `control-buffer-256` feature of +the usb-device crate: + +Cargo.toml: +``` +usb-device = { version = ">=0.2.1", features = ["control-buffer-256"] } +``` + +Up to 5 in/out pairs can be used this way until we again run out of buffer +space. Note that exceeding the available buffer space will silently fail +to send the descriptors correctly, no obvious `panic!` will hint the +actual problem.