You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MIDI_CREATE_DEFAULT_INSTANCE() binds to "Serial" by default, which is known to break on certain boards. There already is special casing to handle Leonardo, Due, and (as far as I understand) some Teensy variants.
On popular STM32(duino) variants, Serial is similarly wired to the USB port, instead of external connectors (apparently including all STM32F103 boards, according to http://wiki.stm32duino.com/index.php?title=API#Serial_.26_USB_Serial), and should thus default to using "Serial1", too. Given that the STM32 chips (all 32-bit arm chips?) all come with a multitude of Serial ports, that seems like a natural choice, too.
Thus, instead of trying to come up with a complete list of board names, I believe it will make most sense to cover the whole family, by checking for defined(arm). I.e.:
diff --git a/src/midi_Defs.h b/src/midi_Defs.h
index 9adec03..126f4d2 100644
--- a/src/midi_Defs.h+++ b/src/midi_Defs.h@@ -214,7 +214,7 @@ struct RPN
#define MIDI_CREATE_INSTANCE(Type, SerialPort, Name) \
midi::MidiInterface<Type> Name((Type&)SerialPort);
-#if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__)+#if defined(ARDUINO_SAM_DUE) || defined(USBCON) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__) || defined(__arm__)
// Leonardo, Due and other USB boards use Serial1 by default.
#define MIDI_CREATE_DEFAULT_INSTANCE() \
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
MIDI_CREATE_DEFAULT_INSTANCE() binds to "Serial" by default, which is known to break on certain boards. There already is special casing to handle Leonardo, Due, and (as far as I understand) some Teensy variants.
On popular STM32(duino) variants, Serial is similarly wired to the USB port, instead of external connectors (apparently including all STM32F103 boards, according to http://wiki.stm32duino.com/index.php?title=API#Serial_.26_USB_Serial), and should thus default to using "Serial1", too. Given that the STM32 chips (all 32-bit arm chips?) all come with a multitude of Serial ports, that seems like a natural choice, too.
Thus, instead of trying to come up with a complete list of board names, I believe it will make most sense to cover the whole family, by checking for defined(arm). I.e.:
The text was updated successfully, but these errors were encountered: