From 2d64cc3c2ff85bbee654a7054e36c59694d8d8e4 Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Tue, 11 Jan 2022 08:00:48 +0100 Subject: [PATCH] Update CustomBaudRate.ino override DefaultSerialSettings to override BaudRate (and not DefaultSettings ) --- examples/CustomBaudRate/CustomBaudRate.ino | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/CustomBaudRate/CustomBaudRate.ino b/examples/CustomBaudRate/CustomBaudRate.ino index 912eabbf..d554871d 100644 --- a/examples/CustomBaudRate/CustomBaudRate.ino +++ b/examples/CustomBaudRate/CustomBaudRate.ino @@ -2,16 +2,17 @@ // Override the default MIDI baudrate to // a decoding program such as Hairless MIDI (set baudrate to 115200) - -struct CustomBaudRate : public MIDI_NAMESPACE::DefaultSettings { +struct CustomBaudRateSettings : public MIDI_NAMESPACE::DefaultSerialSettings { static const long BaudRate = 115200; }; #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); + MIDI_NAMESPACE::SerialMIDI serialMIDI(Serial1); + MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); #else - MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, CustomBaudRate); + MIDI_NAMESPACE::SerialMIDI serialMIDI(Serial); + MIDI_NAMESPACE::MidiInterface> MIDI((MIDI_NAMESPACE::SerialMIDI&)serialMIDI); #endif void setup() { @@ -28,4 +29,4 @@ void loop() { MIDI.sendNoteOff(42, 0, 1); // Stop the note digitalWrite(LED_BUILTIN, LOW); } -} \ No newline at end of file +}