From 2b9e63f0957a5c4212a44d655a6a7ec7cdc1b9ad Mon Sep 17 00:00:00 2001 From: Rolel 42 Date: Sun, 26 Apr 2020 17:08:56 +0200 Subject: [PATCH] [FIX] Repair missing MIDI_CREATE_CUSTOM_INSTANCE The MIDI_CREATE_CUSTOM_INSTANCE function was removed with 5.0 branch. This commit brings it back. --- src/serialMIDI.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/serialMIDI.h b/src/serialMIDI.h index c7176c40..da782715 100644 --- a/src/serialMIDI.h +++ b/src/serialMIDI.h @@ -113,5 +113,13 @@ class SerialMIDI MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI); #endif +/*! \brief Create an instance of the library attached to a serial port with + custom settings. + @see DefaultSettings + @see MIDI_CREATE_INSTANCE + */ +#define MIDI_CREATE_CUSTOM_INSTANCE(Type, SerialPort, Name, Settings) \ + MIDI_NAMESPACE::SerialMIDI serial##Name(SerialPort);\ + MIDI_NAMESPACE::MidiInterface> Name((MIDI_NAMESPACE::SerialMIDI&)serial##Name); END_MIDI_NAMESPACE