File tree Expand file tree Collapse file tree 1 file changed +8
-22
lines changed Expand file tree Collapse file tree 1 file changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -222,28 +222,14 @@ size_t getArduinoLoopTaskStackSize(void);
222
222
return sz; \
223
223
}
224
224
225
- #if CONFIG_TINYUSB_MIDI_ENABLE
226
- // Forward declaration of USBMIDI class for the SET_USB_MIDI_DEVICE_NAME macro
227
- #include " USB/USBMIDI.h"
228
- #define SET_USB_MIDI_DEVICE_NAME (name ) \
229
- namespace { \
230
- static const char * _usb_midi_default_name = name; \
231
- static struct _USBMIDINameSetter { \
232
- _USBMIDINameSetter () { \
233
- USBMIDI::setDefaultName (_usb_midi_default_name); \
234
- } \
235
- } _usb_midi_name_setter; \
236
- }
237
- #else
238
- #define SET_USB_MIDI_DEVICE_NAME (name ) \
239
- namespace { \
240
- static struct _USBMIDINameSetter { \
241
- _USBMIDINameSetter () { \
242
- log_e (" USB MIDI is not enabled. Enable it in menuconfig under Component Config -> TinyUSB -> CDC Enable" ); \
243
- } \
244
- } _usb_midi_name_setter; \
245
- }
246
- #endif
225
+ #define ESP32_USB_MIDI_DEFAULT_NAME " TinyUSB MIDI"
226
+ #define SET_USB_MIDI_DEVICE_NAME (name ) \
227
+ const char * getUSBMIDIDefaultDeviceName () { \
228
+ if (strlen (name) == 0 ) { \
229
+ return ESP32_USB_MIDI_DEFAULT_NAME; \
230
+ } \
231
+ return name; \
232
+ }
247
233
248
234
bool shouldPrintChipDebugReport (void );
249
235
#define ENABLE_CHIP_DEBUG_REPORT \
You can’t perform that action at this time.
0 commit comments