diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..286f94b --- /dev/null +++ b/Changelog.md @@ -0,0 +1,16 @@ +# Changelog +## 2023.08.12(1.0.1) +- Add new API ```void setCableNumber(uint8_t cn)``` + +## 2021.05.10(1.0.0) +- GA +- update document + +## 2021.05.06(0.0.3) +- Add UHS2MIDI_CREATE_CUSTOM_INSTANCE macro + +## 2021.05.02(0.0.2) +- Refactaring: improve performance and reduce SRAM usage + +## 2021.04.30(0.0.1) +- initial release diff --git a/README.md b/README.md index dccfeea..d9a80fd 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,22 @@ MIDI_NAMESPACE::MidiInterface MIDI2((UHS2 ``` will create a instance named `uhs2MIDI2` (and underlaying MIDI object `MIDI2`) and is by default connected to cable number 5. +### Change CableNumber +```cpp +#include +... +USB Usb; +UHS2MIDI_CREATE_DEFAULT_INSTANCE(&Usb); +void setup() +{ + MIDI.begin(4); // Launch MIDI and listen to channel 4 + MIDI.getTransport()->setCableNumber(1); // Change CableNumber to 1 later +``` ## Tested boards / modules -- Arduino UNO +- Arduino UNO R3 + +## Changelog +[Chagelog](/Changelog.md) ## Other Transport protocols: The libraries below the same calling mechanism (API), making it easy to interchange the transport layer. diff --git a/library.properties b/library.properties index cf081b0..0ed9481 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=UHS2-MIDI -version=1.0.0 +version=1.0.1 author=Yuuichi Akagawa maintainer=Yuuichi AKagawa sentence=USB Host Shield Library 2.0 MIDI I/O for Arduino diff --git a/src/UHS2-MIDI.h b/src/UHS2-MIDI.h index 38b083e..f3d8313 100644 --- a/src/UHS2-MIDI.h +++ b/src/UHS2-MIDI.h @@ -24,7 +24,7 @@ SOFTWARE. * Original version: https://github.com/lathoub/Arduino-USBMIDI/blob/master/src/USB-MIDI.h * * Modified for the USB Host Shield 2.0 + USBH_MIDI - * copyright (c) 2020-2021 Yuuichi Akagawa + * copyright (c) 2020-2023 Yuuichi Akagawa ******************************************************************************* */ #pragma once @@ -35,6 +35,8 @@ SOFTWARE. #include "UHS2-MIDI_defs.h" #include "UHS2-MIDI_Namespace.h" +#define UHS2_MIDI_VERSION 10001 + BEGIN_UHS2MIDI_NAMESPACE class uhs2MidiTransport : public USBH_MIDI { @@ -162,6 +164,12 @@ class uhs2MidiTransport : public USBH_MIDI } return mRxLength; }; + + void setCableNumber(uint8_t cn){ + if( cn > 15 ) + return; + cableNumber = cn; + }; }; END_UHS2MIDI_NAMESPACE