mirror of https://github.com/g4klx/MMDVM.git
Rationalisation of debugging messages.
This commit is contained in:
parent
d957ec6e36
commit
4d9f8d19e2
6
Debug.h
6
Debug.h
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -31,8 +31,6 @@
|
|||
#define DEBUG4(a,b,c,d) serial.writeDebug((a),(b),(c),(d))
|
||||
#define DEBUG5(a,b,c,d,e) serial.writeDebug((a),(b),(c),(d),(e))
|
||||
#define ASSERT(a) serial.writeAssert((a),#a,__FILE__,__LINE__)
|
||||
#define DUMP(a,b) serial.writeDump((a),(b))
|
||||
#define SAMPLES(a,b) serial.writeSamples((a),(b))
|
||||
|
||||
#else
|
||||
|
||||
|
@ -42,8 +40,6 @@
|
|||
#define DEBUG4(a,b,c,d)
|
||||
#define DEBUG5(a,b,c,d,e)
|
||||
#define ASSERT(a)
|
||||
#define DUMP(a,b)
|
||||
#define SAMPLES(a,b)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -51,13 +51,11 @@ const uint8_t MMDVM_YSF_LOST = 0x21U;
|
|||
const uint8_t MMDVM_ACK = 0x70U;
|
||||
const uint8_t MMDVM_NAK = 0x7FU;
|
||||
|
||||
const uint8_t MMDVM_DUMP = 0xF0U;
|
||||
const uint8_t MMDVM_DEBUG1 = 0xF1U;
|
||||
const uint8_t MMDVM_DEBUG2 = 0xF2U;
|
||||
const uint8_t MMDVM_DEBUG3 = 0xF3U;
|
||||
const uint8_t MMDVM_DEBUG4 = 0xF4U;
|
||||
const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
||||
const uint8_t MMDVM_SAMPLES = 0xF8U;
|
||||
|
||||
const uint8_t HARDWARE[] = "MMDVM 20160317 (D-Star/DMR/System Fusion)";
|
||||
|
||||
|
@ -694,42 +692,6 @@ void CSerialPort::write(const uint8_t* data, uint16_t length, bool flush)
|
|||
#endif
|
||||
}
|
||||
|
||||
void CSerialPort::writeDump(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
ASSERT(length <= 252U);
|
||||
|
||||
uint8_t reply[255U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 0U;
|
||||
reply[2U] = MMDVM_DUMP;
|
||||
|
||||
uint8_t count = length * sizeof(uint8_t) + 3U;
|
||||
::memcpy(reply + 3U, data, length * sizeof(uint8_t));
|
||||
|
||||
reply[1U] = count;
|
||||
|
||||
write(reply, count, true);
|
||||
}
|
||||
|
||||
void CSerialPort::writeSamples(const q15_t* data, uint8_t length)
|
||||
{
|
||||
ASSERT(length <= 126U);
|
||||
|
||||
uint8_t reply[255U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 0U;
|
||||
reply[2U] = MMDVM_SAMPLES;
|
||||
|
||||
uint8_t count = length * sizeof(q15_t) + 3U;
|
||||
::memcpy(reply + 3U, data, length * sizeof(q15_t));
|
||||
|
||||
reply[1U] = count;
|
||||
|
||||
write(reply, count, true);
|
||||
}
|
||||
|
||||
void CSerialPort::writeDebug(const char* text)
|
||||
{
|
||||
uint8_t reply[130U];
|
||||
|
|
|
@ -44,10 +44,6 @@ public:
|
|||
|
||||
void writeCalData(const uint8_t* data, uint8_t length);
|
||||
|
||||
void writeDump(const uint8_t* data, uint8_t length);
|
||||
|
||||
void writeSamples(const q15_t* data, uint8_t length);
|
||||
|
||||
void writeDebug(const char* text);
|
||||
void writeDebug(const char* text, int16_t n1);
|
||||
void writeDebug(const char* text, int16_t n1, int16_t n2);
|
||||
|
|
Loading…
Reference in New Issue