Skip to content

Commit 80dfb83

Browse files
Rolelfranky47
authored andcommitted
[FIX] Repair missing MIDI_CREATE_CUSTOM_INSTANCE
The MIDI_CREATE_CUSTOM_INSTANCE function was removed with 5.0 branch. This commit brings it back.
1 parent d0110e4 commit 80dfb83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/serialMIDI.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,13 @@ class SerialMIDI
113113
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDI);
114114
#endif
115115

116+
/*! \brief Create an instance of the library attached to a serial port with
117+
custom settings.
118+
@see DefaultSettings
119+
@see MIDI_CREATE_INSTANCE
120+
*/
121+
#define MIDI_CREATE_CUSTOM_INSTANCE(Type, SerialPort, Name, Settings) \
122+
MIDI_NAMESPACE::SerialMIDI<Type, Settings> serial##Name(SerialPort);\
123+
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<Type, Settings>> Name((MIDI_NAMESPACE::SerialMIDI<Type, Settings>&)serial##Name);
116124

117125
END_MIDI_NAMESPACE

0 commit comments

Comments
 (0)