removed unused inChannel argument from begin, removed logging

This commit is contained in:
lathoub 2020-04-17 22:50:24 +02:00
parent 1e9706aa1a
commit eaa2f29568
2 changed files with 3 additions and 88 deletions

View File

@ -4,8 +4,6 @@
#pragma once #pragma once
#include "utility/Logging.h"
#include <MIDI.h> #include <MIDI.h>
using namespace MIDI_NAMESPACE; using namespace MIDI_NAMESPACE;
@ -32,9 +30,7 @@ private:
private: private:
T mBleClass; T mBleClass;
public: public:
const char* getTransportName() { return "BLE-MIDI"; };
BLEMIDI(const char* deviceName) BLEMIDI(const char* deviceName)
{ {
strncpy(mDeviceName, deviceName, 24); strncpy(mDeviceName, deviceName, 24);
@ -44,7 +40,7 @@ public:
} }
protected: protected:
void begin(MIDI_NAMESPACE::Channel inChannel = 1) void begin()
{ {
mBleClass.begin(mDeviceName, this); mBleClass.begin(mDeviceName, this);
@ -92,17 +88,7 @@ protected:
if (!succes) return mRxIndex; if (!succes) return mRxIndex;
mRxBuffer[mRxIndex++] = byte; mRxBuffer[mRxIndex++] = byte;
/*
N_DEBUG_PRINT("available (");
N_DEBUG_PRINT(mRxIndex);
N_DEBUG_PRINT(") :");
for (size_t j = 0; j < mRxIndex; j++) {
N_DEBUG_PRINT("0x");
N_DEBUG_PRINT(mRxBuffer[j], HEX);
N_DEBUG_PRINT(" ");
}
N_DEBUG_PRINTLN();
*/
return mRxIndex; return mRxIndex;
} }

View File

@ -1,71 +0,0 @@
#pragma once
#ifndef DEBUGSTREAM
#define DEBUGSTREAM Serial
#endif
#define LOG_LEVEL_NONE 0
#define LOG_LEVEL_FATAL 1
#define LOG_LEVEL_ERROR 2
#define LOG_LEVEL_WARNING 3
#define LOG_LEVEL_NOTICE 4
#define LOG_LEVEL_TRACE 5
#define LOG_LEVEL_VERBOSE 6
#ifndef DEBUG
#define DEBUG LOG_LEVEL_NONE
#endif
#if DEBUG > LOG_LEVEL_NONE
#define DEBUG_BEGIN(SPEED) \
DEBUGSTREAM.begin(SPEED); \
while (!DEBUGSTREAM) \
; \
DEBUGSTREAM.println(F("Booting..."));
#define F_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define F_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define DEBUG_BEGIN(SPEED)
#define F_DEBUG_PRINT(...)
#define F_DEBUG_PRINTLN(...)
#endif
#if DEBUG >= LOG_LEVEL_ERROR
#define E_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define E_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define E_DEBUG_PRINT(...)
#define E_DEBUG_PRINTLN(...)
#endif
#if DEBUG >= LOG_LEVEL_WARNING
#define W_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define W_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define W_DEBUG_PRINT(...)
#define W_DEBUG_PRINTLN(...)
#endif
#if DEBUG >= LOG_LEVEL_NOTICE
#define N_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define N_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define N_DEBUG_PRINT(...)
#define N_DEBUG_PRINTLN(...)
#endif
#if DEBUG >= LOG_LEVEL_TRACE
#define T_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define T_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define T_DEBUG_PRINT(...)
#define T_DEBUG_PRINTLN(...)
#endif
#if DEBUG >= LOG_LEVEL_VERBOSE
#define V_DEBUG_PRINT(...) DEBUGSTREAM.print(__VA_ARGS__)
#define V_DEBUG_PRINTLN(...) DEBUGSTREAM.println(__VA_ARGS__)
#else
#define V_DEBUG_PRINT(...)
#define V_DEBUG_PRINTLN(...)
#endif