Skip to content

Commit ff3052c

Browse files
lathoubfranky47
lathoub
authored andcommitted
fix bug in MIDI_CREATE_CUSTOM_INSTANCE
- MIDI Setting in MIDI_CREATE_CUSTOM_INSTANCE, but Setting for SerialMIDI - MACRO outside of Namespace
1 parent e5ee620 commit ff3052c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/midi_Settings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ BEGIN_MIDI_NAMESPACE
3838
macro to create your instance. The settings you don't override will keep their
3939
default value. Eg:
4040
\code{.cpp}
41-
struct MySettings : public midi::DefaultSettings
41+
struct MySettings : public MIDI_NAMESPACE::DefaultSettings
4242
{
4343
static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long.
4444
};
4545
46-
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial2, midi, MySettings);
46+
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial2, MIDI, MySettings);
4747
\endcode
4848
*/
4949
struct DefaultSettings

src/serialMIDI.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ class SerialMIDI
9191
SerialPort& mSerial;
9292
};
9393

94+
END_MIDI_NAMESPACE
95+
9496
/*! \brief Create an instance of the library attached to a serial port.
9597
You can use HardwareSerial or SoftwareSerial for the serial port.
9698
Example: MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, midi2);
@@ -119,7 +121,5 @@ class SerialMIDI
119121
@see MIDI_CREATE_INSTANCE
120122
*/
121123
#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);
124-
125-
END_MIDI_NAMESPACE
124+
MIDI_NAMESPACE::SerialMIDI<Type> serial##Name(SerialPort);\
125+
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<Type>, Settings> Name((MIDI_NAMESPACE::SerialMIDI<Type>&)serial##Name);

0 commit comments

Comments
 (0)