fixed compile error for boards that have no Serial

This commit is contained in:
lathoub 2022-01-11 07:17:11 +01:00
parent 596a1b0721
commit 70b9e26d45
1 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,12 @@ struct CustomBaudRate : public MIDI_NAMESPACE::DefaultSettings {
static const long BaudRate = 115200; static const long BaudRate = 115200;
}; };
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, CustomBaudRate); #if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__)
// Leonardo, Due and other USB boards use Serial1 by default.
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, CustomBaudRate);
#else
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, CustomBaudRate);
#endif
void setup() { void setup() {
pinMode(LED_BUILTIN, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);