From a1bea899ce5f3c08adfe428f880fcaa777771de9 Mon Sep 17 00:00:00 2001 From: Francois Best Date: Tue, 22 May 2012 23:33:58 +0200 Subject: [PATCH] Changed macro name. --- src/MIDI.cpp | 40 ++++++++++++++++++++-------------------- src/MIDI.h | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/MIDI.cpp b/src/MIDI.cpp index 71fec37..28f8b19 100644 --- a/src/MIDI.cpp +++ b/src/MIDI.cpp @@ -68,7 +68,7 @@ void MIDI_Class::begin(const byte inChannel) { // Initialise the Serial port - USE_SERIAL_PORT.begin(MIDI_BAUDRATE); + MIDI_SERIAL_PORT.begin(MIDI_BAUDRATE); #if COMPILE_MIDI_OUT @@ -158,17 +158,17 @@ void MIDI_Class::send(kMIDIType type, if (mRunningStatus_TX != statusbyte) { // New message, memorise and send header mRunningStatus_TX = statusbyte; - USE_SERIAL_PORT.write(mRunningStatus_TX); + MIDI_SERIAL_PORT.write(mRunningStatus_TX); } #else // Don't care about running status, send the Control byte. - USE_SERIAL_PORT.write(statusbyte); + MIDI_SERIAL_PORT.write(statusbyte); #endif // Then send data - USE_SERIAL_PORT.write(data1); + MIDI_SERIAL_PORT.write(data1); if (type != ProgramChange && type != AfterTouchChannel) { - USE_SERIAL_PORT.write(data2); + MIDI_SERIAL_PORT.write(data2); } return; } @@ -321,22 +321,22 @@ void MIDI_Class::sendSysEx(int length, if (ArrayContainsBoundaries == false) { - USE_SERIAL_PORT.write(0xF0); + MIDI_SERIAL_PORT.write(0xF0); for (int i=0;i> 7) & 0x7F); + MIDI_SERIAL_PORT.write((byte)SongPosition); + MIDI_SERIAL_PORT.write(Beats & 0x7F); + MIDI_SERIAL_PORT.write((Beats >> 7) & 0x7F); #if USE_RUNNING_STATUS mRunningStatus_TX = InvalidType; @@ -415,8 +415,8 @@ void MIDI_Class::sendSongPosition(unsigned int Beats) void MIDI_Class::sendSongSelect(byte SongNumber) { - USE_SERIAL_PORT.write((byte)SongSelect); - USE_SERIAL_PORT.write(SongNumber & 0x7F); + MIDI_SERIAL_PORT.write((byte)SongSelect); + MIDI_SERIAL_PORT.write(SongNumber & 0x7F); #if USE_RUNNING_STATUS mRunningStatus_TX = InvalidType; @@ -441,7 +441,7 @@ void MIDI_Class::sendRealTime(kMIDIType Type) case Continue: case ActiveSensing: case SystemReset: - USE_SERIAL_PORT.write((byte)Type); + MIDI_SERIAL_PORT.write((byte)Type); break; default: // Invalid Real Time marker @@ -508,7 +508,7 @@ bool MIDI_Class::read(const byte inChannel) bool MIDI_Class::parse(byte inChannel) { - const int bytes_available = USE_SERIAL_PORT.available(); + const int bytes_available = MIDI_SERIAL_PORT.available(); if (bytes_available <= 0) { // No data available. @@ -517,7 +517,7 @@ bool MIDI_Class::parse(byte inChannel) // If the buffer is full -> Don't Panic! Call the Vogons to destroy it. if (bytes_available == UART_BUFFER_SIZE) { Serial << "Overflow, call the Vogons!!" << endl; - USE_SERIAL_PORT.flush(); + MIDI_SERIAL_PORT.flush(); } else { @@ -530,7 +530,7 @@ bool MIDI_Class::parse(byte inChannel) */ - const byte extracted = USE_SERIAL_PORT.read(); + const byte extracted = MIDI_SERIAL_PORT.read(); if (mPendingMessageIndex == 0) { // Start a new pending message mPendingMessage[0] = extracted; diff --git a/src/MIDI.h b/src/MIDI.h index d1c4ef8..6fb3184 100644 --- a/src/MIDI.h +++ b/src/MIDI.h @@ -34,7 +34,7 @@ // Please note that the Thru will work only when both COMPILE_MIDI_IN and COMPILE_MIDI_OUT set to 1. -#define USE_SERIAL_PORT Serial1 // Change the number (to Serial1 for example) if you want +#define MIDI_SERIAL_PORT Serial1 // Change the number (to Serial1 for example) if you want // to use a different serial port for MIDI I/O.