diff --git a/src/midi_Settings.h b/src/midi_Settings.h index aa6f151..179b773 100644 --- a/src/midi_Settings.h +++ b/src/midi_Settings.h @@ -99,23 +99,6 @@ struct DefaultSettings Setting this field to 0 will disable sending MIDI active sensing. */ static const uint16_t SenderActiveSensingPeriodicity = 0; - - #if defined(TEENSYDUINO) - /*! Teensy supports various Serial data formats. - This allows to use circuits that may require inversion of polarity on the RX, TX - or both signals - - Format Name Data Bits Parity Stop Bits RX Polarity TX Polarity - - SERIAL_8N1 8 None Normal Normal - SERIAL_8N1_RXINV 8 None Inverted Normal - SERIAL_8N1_TXINV 8 None Normal Inverted - SERIAL_8N1_RXINV_TXINV 8 None Inverted Inverted - - Default is SERIAL_8N1 - */ - static const uint16_t SerialFormat = SERIAL_8N1; - #endif }; END_MIDI_NAMESPACE diff --git a/src/serialMIDI.h b/src/serialMIDI.h index b2a3838..51d2d68 100644 --- a/src/serialMIDI.h +++ b/src/serialMIDI.h @@ -30,13 +30,29 @@ BEGIN_MIDI_NAMESPACE -struct DefaultSerialSettings +struct DefaultSerialSettings : public MIDI_NAMESPACE::DefaultSettings { /*! Override the default MIDI baudrate to transmit over USB serial, to a decoding program such as Hairless MIDI (set baudrate to 115200)\n http://projectgus.github.io/hairless-midiserial/ */ static const long BaudRate = 31250; + #if defined(TEENSYDUINO) + /*! Teensy supports various Serial data formats. + Override the default Serial Format to use circuits that may require inversion of + polarity on the RX, TX or both signals. + https://www.pjrc.com/teensy/td_serial.html + + Format Name Data Bits Parity RX Polarity TX Polarity + + SERIAL_8N1 8 None Normal Normal + SERIAL_8N1_RXINV 8 None Inverted Normal + SERIAL_8N1_TXINV 8 None Normal Inverted + SERIAL_8N1_RXINV_TXINV 8 None Inverted Inverted + + */ + static const uint16_t SerialFormat = SERIAL_8N1; + #endif }; template @@ -123,5 +139,5 @@ END_MIDI_NAMESPACE @see MIDI_CREATE_INSTANCE */ #define MIDI_CREATE_CUSTOM_INSTANCE(Type, SerialPort, Name, Settings) \ - MIDI_NAMESPACE::SerialMIDI serial##Name(SerialPort);\ - MIDI_NAMESPACE::MidiInterface, Settings> Name((MIDI_NAMESPACE::SerialMIDI&)serial##Name); + MIDI_NAMESPACE::SerialMIDI serial##Name(SerialPort);\ + MIDI_NAMESPACE::MidiInterface, Settings> Name((MIDI_NAMESPACE::SerialMIDI&)serial##Name);