diff --git a/src/MIDI_Interfaces/DebugMIDI_Interface.hpp b/src/MIDI_Interfaces/DebugMIDI_Interface.hpp index 9425afe0d1..135d2f46ff 100644 --- a/src/MIDI_Interfaces/DebugMIDI_Interface.hpp +++ b/src/MIDI_Interfaces/DebugMIDI_Interface.hpp @@ -167,47 +167,6 @@ class USBDebugMIDI_Output : public SerialDebugMIDI_Output { : SerialDebugMIDI_Output(Serial, prefix) {} }; -END_CS_NAMESPACE - -// TODO: Teensy 4.0 SoftwareSerial bug -#if defined(__AVR__) || (defined(TEENSYDUINO) && TEENSYDUINO != 147) || \ - (defined(TEENSYDUINO) && !defined(__IMXRT1052__) && \ - !defined(__IMXRT1062__)) -#include - -BEGIN_CS_NAMESPACE - -/** - * @brief A class for debug MIDI outputs sending - * human-readable MIDI messages over a SoftwareSerial interface. - * - * @ingroup MIDIInterfaces - */ -class SoftwareSerialDebugMIDI_Output - : public SerialDebugMIDI_Output { - public: - /** - * @brief Construct a SoftwareSerialDebugMIDI_Output on the given - * SoftwareSerial interface with the given baud rate. - * - * @param serial - * The SoftwareSerial interface. - * @param baud - * The baud rate for the serial interface. - * @param prefix - * An optional string to print before each message. - */ - SoftwareSerialDebugMIDI_Output(SoftwareSerial &serial, unsigned long baud, - const char *prefix = nullptr) - : SerialDebugMIDI_Output(serial, baud, prefix) {} -}; - -END_CS_NAMESPACE - -#endif - -BEGIN_CS_NAMESPACE - /** * @brief A class for MIDI interfaces sending and receiving * human-readable MIDI messages over a Stream. @@ -368,45 +327,3 @@ class USBDebugMIDI_Interface }; END_CS_NAMESPACE - -// TODO: Teensy 4.0 SoftwareSerial bug -#if defined(__AVR__) || (defined(TEENSYDUINO) && TEENSYDUINO != 147) || \ - (defined(TEENSYDUINO) && !defined(__IMXRT1052__) && \ - !defined(__IMXRT1062__)) -#include - -BEGIN_CS_NAMESPACE - -/** - * @brief A class for debug MIDI interfaces sending and receiving - * human-readable MIDI messages over a SoftwareSerial interface. - * - * @ingroup MIDIInterfaces - */ -class SoftwareSerialDebugMIDI_Interface - : public SerialDebugMIDI_Interface { - public: - /** - * @brief Construct a SoftwareSerialDebugMIDI_Interface on the given - * SoftwareSerial interface with the given baud rate. - * - * @param serial - * The SoftwareSerial interface. - * @param baud - * The baud rate for the serial interface. - * @param prefix - * An optional string to print before each message. - */ - SoftwareSerialDebugMIDI_Interface(SoftwareSerial &serial, - unsigned long baud, - const char *prefix = nullptr) - : SerialDebugMIDI_Interface(serial, baud, prefix) {} - /// @see @ref SoftwareSerialDebugMIDI_Interface(SoftwareSerial &,unsigned long,const char *) - SoftwareSerialDebugMIDI_Interface(SoftwareSerial &serial, - const char *prefix) - : SerialDebugMIDI_Interface(serial, prefix) {} -}; - -END_CS_NAMESPACE - -#endif diff --git a/src/MIDI_Interfaces/SerialMIDI_Interface.hpp b/src/MIDI_Interfaces/SerialMIDI_Interface.hpp index c5f7dd2e0e..20f3545580 100644 --- a/src/MIDI_Interfaces/SerialMIDI_Interface.hpp +++ b/src/MIDI_Interfaces/SerialMIDI_Interface.hpp @@ -160,41 +160,4 @@ class HairlessMIDI_Interface : public USBSerialMIDI_Interface { }; #endif -END_CS_NAMESPACE - -// -------------------------------------------------------------------------- // - -// TODO: Teensy 4.0 SoftwareSerial bug -#if defined(__AVR__) || (defined(TEENSYDUINO) && TEENSYDUINO != 147) || \ - (defined(TEENSYDUINO) && !defined(__IMXRT1052__) && \ - !defined(__IMXRT1062__)) - -#include - -BEGIN_CS_NAMESPACE - -/** - * @brief A class for MIDI interfaces sending and receiving - * MIDI messages over a SoftwareSerial interface. - * - * @ingroup MIDIInterfaces - */ -class SoftwareSerialMIDI_Interface - : public SerialMIDI_Interface { - public: - /** - * @brief Create a SoftwareSerialMIDI_Interface on the given - * SoftwareSerial interface with the given baud rate. - * - * @param serial - * The SoftwareSerial interface. - * @param baud - * The baud rate for the serial interface. - */ - SoftwareSerialMIDI_Interface(SoftwareSerial &serial, unsigned long baud) - : SerialMIDI_Interface(serial, baud) {} -}; - -END_CS_NAMESPACE - -#endif \ No newline at end of file +END_CS_NAMESPACE \ No newline at end of file diff --git a/src/MIDI_Interfaces/SoftwareSerialDebugMIDI_Interface.hpp b/src/MIDI_Interfaces/SoftwareSerialDebugMIDI_Interface.hpp new file mode 100644 index 0000000000..3eeeeef3a0 --- /dev/null +++ b/src/MIDI_Interfaces/SoftwareSerialDebugMIDI_Interface.hpp @@ -0,0 +1,70 @@ +#pragma once + +// TODO: Teensy 4.0 SoftwareSerial bug +#if defined(__AVR__) || (defined(TEENSYDUINO) && TEENSYDUINO != 147) || \ + (defined(TEENSYDUINO) && !defined(__IMXRT1052__) && \ + !defined(__IMXRT1062__)) + +#include "DebugMIDI_Interface.hpp" +#include + +BEGIN_CS_NAMESPACE + +/** + * @brief A class for debug MIDI interfaces sending and receiving + * human-readable MIDI messages over a SoftwareSerial interface. + * + * @ingroup MIDIInterfaces + */ +class SoftwareSerialDebugMIDI_Interface + : public SerialDebugMIDI_Interface { + public: + /** + * @brief Construct a SoftwareSerialDebugMIDI_Interface on the given + * SoftwareSerial interface with the given baud rate. + * + * @param serial + * The SoftwareSerial interface. + * @param baud + * The baud rate for the serial interface. + * @param prefix + * An optional string to print before each message. + */ + SoftwareSerialDebugMIDI_Interface(SoftwareSerial &serial, + unsigned long baud, + const char *prefix = nullptr) + : SerialDebugMIDI_Interface(serial, baud, prefix) {} + /// @see @ref SoftwareSerialDebugMIDI_Interface(SoftwareSerial &,unsigned long,const char *) + SoftwareSerialDebugMIDI_Interface(SoftwareSerial &serial, + const char *prefix) + : SerialDebugMIDI_Interface(serial, prefix) {} +}; + +/** + * @brief A class for debug MIDI outputs sending + * human-readable MIDI messages over a SoftwareSerial interface. + * + * @ingroup MIDIInterfaces + */ +class SoftwareSerialDebugMIDI_Output + : public SerialDebugMIDI_Output { + public: + /** + * @brief Construct a SoftwareSerialDebugMIDI_Output on the given + * SoftwareSerial interface with the given baud rate. + * + * @param serial + * The SoftwareSerial interface. + * @param baud + * The baud rate for the serial interface. + * @param prefix + * An optional string to print before each message. + */ + SoftwareSerialDebugMIDI_Output(SoftwareSerial &serial, unsigned long baud, + const char *prefix = nullptr) + : SerialDebugMIDI_Output(serial, baud, prefix) {} +}; + +END_CS_NAMESPACE + +#endif \ No newline at end of file diff --git a/src/MIDI_Interfaces/SoftwareSerialMIDI_Interface.hpp b/src/MIDI_Interfaces/SoftwareSerialMIDI_Interface.hpp new file mode 100644 index 0000000000..53e2f595e0 --- /dev/null +++ b/src/MIDI_Interfaces/SoftwareSerialMIDI_Interface.hpp @@ -0,0 +1,37 @@ +#pragma once + +// TODO: Teensy 4.0 SoftwareSerial bug +#if defined(__AVR__) || (defined(TEENSYDUINO) && TEENSYDUINO != 147) || \ + (defined(TEENSYDUINO) && !defined(__IMXRT1052__) && \ + !defined(__IMXRT1062__)) + +#include "SerialMIDI_Interface.hpp" +#include + +BEGIN_CS_NAMESPACE + +/** + * @brief A class for MIDI interfaces sending and receiving + * MIDI messages over a SoftwareSerial interface. + * + * @ingroup MIDIInterfaces + */ +class SoftwareSerialMIDI_Interface + : public SerialMIDI_Interface { + public: + /** + * @brief Create a SoftwareSerialMIDI_Interface on the given + * SoftwareSerial interface with the given baud rate. + * + * @param serial + * The SoftwareSerial interface. + * @param baud + * The baud rate for the serial interface. + */ + SoftwareSerialMIDI_Interface(SoftwareSerial &serial, unsigned long baud) + : SerialMIDI_Interface(serial, baud) {} +}; + +END_CS_NAMESPACE + +#endif