Skip to content

Commit b3fbce7

Browse files
authored
feat(usb_midi): Add macro to set USB MIDI device name
1 parent 75d04db commit b3fbce7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cores/esp32/Arduino.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ size_t getArduinoLoopTaskStackSize(void);
222222
return sz; \
223223
}
224224

225+
#define SET_USB_MIDI_DEVICE_NAME(name) \
226+
namespace { \
227+
static const char* _usb_midi_default_name = name; \
228+
static struct _USBMIDINameSetter { \
229+
_USBMIDINameSetter() { \
230+
USBMIDI::setDefaultName(_usb_midi_default_name); \
231+
} \
232+
} _usb_midi_name_setter; \
233+
}
234+
225235
bool shouldPrintChipDebugReport(void);
226236
#define ENABLE_CHIP_DEBUG_REPORT \
227237
bool shouldPrintChipDebugReport(void) { \

0 commit comments

Comments
 (0)