[FIX] Repair missing MIDI_CREATE_CUSTOM_INSTANCE

The MIDI_CREATE_CUSTOM_INSTANCE function was removed with 5.0 branch. This commit brings it back.
This commit is contained in:
Rolel 42 2020-04-26 17:08:56 +02:00 committed by Francois Best
parent d0110e4866
commit 80dfb8333c
1 changed files with 8 additions and 0 deletions

View File

@ -113,5 +113,13 @@ private:
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI); MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI);
#endif #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<Type, Settings> serial##Name(SerialPort);\
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<Type, Settings>> Name((MIDI_NAMESPACE::SerialMIDI<Type, Settings>&)serial##Name);
END_MIDI_NAMESPACE END_MIDI_NAMESPACE