mirror of https://github.com/markqvist/MMDVM.git
Remove the unused sample dumping code.
parent
453fb33b76
commit
016ed333ec
46
DMRDMORX.cpp
46
DMRDMORX.cpp
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#define WANT_DEBUG
|
#define WANT_DEBUG
|
||||||
|
|
||||||
// #define DUMP_SAMPLES
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "DMRDMORX.h"
|
#include "DMRDMORX.h"
|
||||||
|
@ -147,9 +145,6 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
|
||||||
case DT_DATA_HEADER:
|
case DT_DATA_HEADER:
|
||||||
DEBUG4("DMRDMORX: data header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: data header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMORXS_DATA;
|
m_state = DMORXS_DATA;
|
||||||
m_type = 0x00U;
|
m_type = 0x00U;
|
||||||
break;
|
break;
|
||||||
|
@ -159,27 +154,18 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
|
||||||
if (m_state == DMORXS_DATA) {
|
if (m_state == DMORXS_DATA) {
|
||||||
DEBUG4("DMRDMORX: data payload found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: data payload found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_type = dataType;
|
m_type = dataType;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DT_VOICE_LC_HEADER:
|
case DT_VOICE_LC_HEADER:
|
||||||
DEBUG4("DMRDMORX: voice header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: voice header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMORXS_VOICE;
|
m_state = DMORXS_VOICE;
|
||||||
break;
|
break;
|
||||||
case DT_VOICE_PI_HEADER:
|
case DT_VOICE_PI_HEADER:
|
||||||
if (m_state == DMORXS_VOICE) {
|
if (m_state == DMORXS_VOICE) {
|
||||||
DEBUG4("DMRDMORX: voice pi header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: voice pi header found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
m_state = DMORXS_VOICE;
|
m_state = DMORXS_VOICE;
|
||||||
break;
|
break;
|
||||||
|
@ -187,18 +173,12 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
|
||||||
if (m_state == DMORXS_VOICE) {
|
if (m_state == DMORXS_VOICE) {
|
||||||
DEBUG4("DMRDMORX: voice terminator found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: voice terminator found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: // DT_CSBK
|
default: // DT_CSBK
|
||||||
DEBUG4("DMRDMORX: csbk found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: csbk found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
reset();
|
reset();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -207,9 +187,6 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
|
||||||
// Voice sync
|
// Voice sync
|
||||||
DEBUG4("DMRDMORX: voice sync found pos/centre/threshold", m_syncPtr, centre, threshold);
|
DEBUG4("DMRDMORX: voice sync found pos/centre/threshold", m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMORXS_VOICE;
|
m_state = DMORXS_VOICE;
|
||||||
m_syncCount = 0U;
|
m_syncCount = 0U;
|
||||||
m_n = 0U;
|
m_n = 0U;
|
||||||
|
@ -231,16 +208,10 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
|
||||||
}
|
}
|
||||||
|
|
||||||
serial.writeDMRData(true, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(true, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
} else if (m_state == DMORXS_DATA) {
|
} else if (m_state == DMORXS_DATA) {
|
||||||
if (m_type != 0x00U) {
|
if (m_type != 0x00U) {
|
||||||
frame[0U] = CONTROL_DATA | m_type;
|
frame[0U] = CONTROL_DATA | m_type;
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -454,20 +425,3 @@ void CDMRDMORX::writeRSSIData(uint8_t* frame)
|
||||||
serial.writeDMRData(true, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(true, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
void CDMRDMORX::writeSamples(uint16_t start, uint8_t control)
|
|
||||||
{
|
|
||||||
q15_t samples[DMR_FRAME_LENGTH_SYMBOLS];
|
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < DMR_FRAME_LENGTH_SYMBOLS; i++) {
|
|
||||||
samples[i] = m_buffer[start];
|
|
||||||
|
|
||||||
start += DMR_RADIO_SYMBOL_LENGTH;
|
|
||||||
if (start >= DMO_BUFFER_LENGTH_SAMPLES)
|
|
||||||
start -= DMO_BUFFER_LENGTH_SAMPLES;
|
|
||||||
}
|
|
||||||
|
|
||||||
serial.writeSamples(STATE_DMR, control, samples, DMR_FRAME_LENGTH_SYMBOLS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ private:
|
||||||
void correlateSync(bool first);
|
void correlateSync(bool first);
|
||||||
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
||||||
void writeRSSIData(uint8_t* frame);
|
void writeRSSIData(uint8_t* frame);
|
||||||
void writeSamples(uint16_t start, uint8_t control);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#define WANT_DEBUG
|
#define WANT_DEBUG
|
||||||
|
|
||||||
// #define DUMP_SAMPLES
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "DMRIdleRX.h"
|
#include "DMRIdleRX.h"
|
||||||
|
@ -161,9 +159,6 @@ void CDMRIdleRX::processSample(q15_t sample)
|
||||||
if (colorCode == m_colorCode && dataType == DT_CSBK) {
|
if (colorCode == m_colorCode && dataType == DT_CSBK) {
|
||||||
frame[0U] = CONTROL_IDLE | CONTROL_DATA | DT_CSBK;
|
frame[0U] = CONTROL_IDLE | CONTROL_DATA | DT_CSBK;
|
||||||
serial.writeDMRData(false, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(false, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_endPtr = NOENDPTR;
|
m_endPtr = NOENDPTR;
|
||||||
|
@ -216,20 +211,3 @@ void CDMRIdleRX::setColorCode(uint8_t colorCode)
|
||||||
{
|
{
|
||||||
m_colorCode = colorCode;
|
m_colorCode = colorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
void CDMRIdleRX::writeSamples(uint16_t start, uint8_t control)
|
|
||||||
{
|
|
||||||
q15_t samples[DMR_FRAME_LENGTH_SYMBOLS];
|
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < DMR_FRAME_LENGTH_SYMBOLS; i++) {
|
|
||||||
samples[i] = m_buffer[start];
|
|
||||||
|
|
||||||
start += DMR_RADIO_SYMBOL_LENGTH;
|
|
||||||
if (start >= DMR_FRAME_LENGTH_SAMPLES)
|
|
||||||
start -= DMR_FRAME_LENGTH_SAMPLES;
|
|
||||||
}
|
|
||||||
|
|
||||||
serial.writeSamples(STATE_DMR, control, samples, DMR_FRAME_LENGTH_SYMBOLS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ private:
|
||||||
|
|
||||||
void processSample(q15_t sample);
|
void processSample(q15_t sample);
|
||||||
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
||||||
void writeSamples(uint16_t start, uint8_t control);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#define WANT_DEBUG
|
#define WANT_DEBUG
|
||||||
|
|
||||||
// #define DUMP_SAMPLES
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "DMRSlotRX.h"
|
#include "DMRSlotRX.h"
|
||||||
|
@ -150,9 +148,6 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
case DT_DATA_HEADER:
|
case DT_DATA_HEADER:
|
||||||
DEBUG5("DMRSlotRX: data header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: data header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMRRXS_DATA;
|
m_state = DMRRXS_DATA;
|
||||||
m_type = 0x00U;
|
m_type = 0x00U;
|
||||||
break;
|
break;
|
||||||
|
@ -162,27 +157,18 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
if (m_state == DMRRXS_DATA) {
|
if (m_state == DMRRXS_DATA) {
|
||||||
DEBUG5("DMRSlotRX: data payload found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: data payload found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_type = dataType;
|
m_type = dataType;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DT_VOICE_LC_HEADER:
|
case DT_VOICE_LC_HEADER:
|
||||||
DEBUG5("DMRSlotRX: voice header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: voice header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMRRXS_VOICE;
|
m_state = DMRRXS_VOICE;
|
||||||
break;
|
break;
|
||||||
case DT_VOICE_PI_HEADER:
|
case DT_VOICE_PI_HEADER:
|
||||||
if (m_state == DMRRXS_VOICE) {
|
if (m_state == DMRRXS_VOICE) {
|
||||||
DEBUG5("DMRSlotRX: voice pi header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: voice pi header found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
m_state = DMRRXS_VOICE;
|
m_state = DMRRXS_VOICE;
|
||||||
break;
|
break;
|
||||||
|
@ -190,9 +176,6 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
if (m_state == DMRRXS_VOICE) {
|
if (m_state == DMRRXS_VOICE) {
|
||||||
DEBUG5("DMRSlotRX: voice terminator found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: voice terminator found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMRRXS_NONE;
|
m_state = DMRRXS_NONE;
|
||||||
m_endPtr = NOENDPTR;
|
m_endPtr = NOENDPTR;
|
||||||
}
|
}
|
||||||
|
@ -200,9 +183,6 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
default: // DT_CSBK
|
default: // DT_CSBK
|
||||||
DEBUG5("DMRSlotRX: csbk found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: csbk found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMRRXS_NONE;
|
m_state = DMRRXS_NONE;
|
||||||
m_endPtr = NOENDPTR;
|
m_endPtr = NOENDPTR;
|
||||||
break;
|
break;
|
||||||
|
@ -212,9 +192,6 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
// Voice sync
|
// Voice sync
|
||||||
DEBUG5("DMRSlotRX: voice sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
DEBUG5("DMRSlotRX: voice sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, m_syncPtr, centre, threshold);
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_state = DMRRXS_VOICE;
|
m_state = DMRRXS_VOICE;
|
||||||
m_syncCount = 0U;
|
m_syncCount = 0U;
|
||||||
m_n = 0U;
|
m_n = 0U;
|
||||||
|
@ -237,16 +214,10 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
||||||
}
|
}
|
||||||
|
|
||||||
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
} else if (m_state == DMRRXS_DATA) {
|
} else if (m_state == DMRRXS_DATA) {
|
||||||
if (m_type != 0x00U) {
|
if (m_type != 0x00U) {
|
||||||
frame[0U] = CONTROL_DATA | m_type;
|
frame[0U] = CONTROL_DATA | m_type;
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(ptr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -431,17 +402,3 @@ void CDMRSlotRX::writeRSSIData(uint8_t* frame)
|
||||||
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
void CDMRSlotRX::writeSamples(uint16_t start, uint8_t control)
|
|
||||||
{
|
|
||||||
q15_t samples[DMR_FRAME_LENGTH_SYMBOLS];
|
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < DMR_FRAME_LENGTH_SYMBOLS; i++) {
|
|
||||||
samples[i] = m_buffer[start];
|
|
||||||
start += DMR_RADIO_SYMBOL_LENGTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
serial.writeSamples(STATE_DMR, control, samples, DMR_FRAME_LENGTH_SYMBOLS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ private:
|
||||||
void correlateSync(bool first);
|
void correlateSync(bool first);
|
||||||
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
void samplesToBits(uint16_t start, uint8_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
||||||
void writeRSSIData(uint8_t* frame);
|
void writeRSSIData(uint8_t* frame);
|
||||||
void writeSamples(uint16_t start, uint8_t control);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
22
P25RX.cpp
22
P25RX.cpp
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#define WANT_DEBUG
|
#define WANT_DEBUG
|
||||||
|
|
||||||
// #define DUMP_SAMPLES
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "P25RX.h"
|
#include "P25RX.h"
|
||||||
|
@ -245,9 +243,6 @@ void CP25RX::processLdu(q15_t sample)
|
||||||
} else {
|
} else {
|
||||||
frame[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
frame[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||||
writeRSSILdu(frame);
|
writeRSSILdu(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(m_lduStartPtr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_maxCorr = 0;
|
m_maxCorr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,20 +466,3 @@ void CP25RX::writeRSSILdu(uint8_t* ldu)
|
||||||
m_rssiAccum = 0U;
|
m_rssiAccum = 0U;
|
||||||
m_rssiCount = 0U;
|
m_rssiCount = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
void CP25RX::writeSamples(uint16_t start, uint8_t control)
|
|
||||||
{
|
|
||||||
q15_t samples[P25_LDU_FRAME_LENGTH_SYMBOLS];
|
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < P25_LDU_FRAME_LENGTH_SYMBOLS; i++) {
|
|
||||||
samples[i] = m_buffer[start];
|
|
||||||
|
|
||||||
start += P25_RADIO_SYMBOL_LENGTH;
|
|
||||||
if (start >= P25_LDU_FRAME_LENGTH_SAMPLES)
|
|
||||||
start -= P25_LDU_FRAME_LENGTH_SAMPLES;
|
|
||||||
}
|
|
||||||
|
|
||||||
serial.writeSamples(STATE_P25, control, samples, P25_LDU_FRAME_LENGTH_SYMBOLS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
1
P25RX.h
1
P25RX.h
|
@ -67,7 +67,6 @@ private:
|
||||||
void calculateLevels(uint16_t start, uint16_t count);
|
void calculateLevels(uint16_t start, uint16_t count);
|
||||||
void samplesToBits(uint16_t start, uint16_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
void samplesToBits(uint16_t start, uint16_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
||||||
void writeRSSILdu(uint8_t* ldu);
|
void writeRSSILdu(uint8_t* ldu);
|
||||||
void writeSamples(uint16_t start, uint8_t control);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -62,8 +62,6 @@ const uint8_t MMDVM_NAK = 0x7FU;
|
||||||
|
|
||||||
const uint8_t MMDVM_SERIAL = 0x80U;
|
const uint8_t MMDVM_SERIAL = 0x80U;
|
||||||
|
|
||||||
const uint8_t MMDVM_SAMPLES = 0xF0U;
|
|
||||||
|
|
||||||
const uint8_t MMDVM_DEBUG1 = 0xF1U;
|
const uint8_t MMDVM_DEBUG1 = 0xF1U;
|
||||||
const uint8_t MMDVM_DEBUG2 = 0xF2U;
|
const uint8_t MMDVM_DEBUG2 = 0xF2U;
|
||||||
const uint8_t MMDVM_DEBUG3 = 0xF3U;
|
const uint8_t MMDVM_DEBUG3 = 0xF3U;
|
||||||
|
@ -920,31 +918,6 @@ void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length)
|
||||||
writeInt(1U, reply, count);
|
writeInt(1U, reply, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSerialPort::writeSamples(uint8_t mode, uint8_t control, const q15_t* samples, uint16_t nSamples)
|
|
||||||
{
|
|
||||||
uint8_t reply[1800U];
|
|
||||||
|
|
||||||
reply[0U] = MMDVM_FRAME_START;
|
|
||||||
reply[1U] = 0U;
|
|
||||||
reply[2U] = MMDVM_SAMPLES;
|
|
||||||
|
|
||||||
reply[5U] = mode;
|
|
||||||
reply[6U] = control;
|
|
||||||
|
|
||||||
uint16_t count = 7U;
|
|
||||||
for (uint16_t i = 0U; i < nSamples; i++) {
|
|
||||||
uint16_t val = uint16_t(samples[i] + 2048);
|
|
||||||
|
|
||||||
reply[count++] = (val >> 8) & 0xFF;
|
|
||||||
reply[count++] = (val >> 0) & 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
reply[3U] = (count >> 8) & 0xFFU;
|
|
||||||
reply[4U] = (count >> 0) & 0xFFU;
|
|
||||||
|
|
||||||
writeInt(1U, reply, count, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSerialPort::writeDebug(const char* text)
|
void CSerialPort::writeDebug(const char* text)
|
||||||
{
|
{
|
||||||
uint8_t reply[130U];
|
uint8_t reply[130U];
|
||||||
|
|
|
@ -49,8 +49,6 @@ public:
|
||||||
void writeCalData(const uint8_t* data, uint8_t length);
|
void writeCalData(const uint8_t* data, uint8_t length);
|
||||||
void writeRSSIData(const uint8_t* data, uint8_t length);
|
void writeRSSIData(const uint8_t* data, uint8_t length);
|
||||||
|
|
||||||
void writeSamples(uint8_t mode, uint8_t control, const q15_t* samples, uint16_t nSamples);
|
|
||||||
|
|
||||||
void writeDebug(const char* text);
|
void writeDebug(const char* text);
|
||||||
void writeDebug(const char* text, int16_t n1);
|
void writeDebug(const char* text, int16_t n1);
|
||||||
void writeDebug(const char* text, int16_t n1, int16_t n2);
|
void writeDebug(const char* text, int16_t n1, int16_t n2);
|
||||||
|
|
22
YSFRX.cpp
22
YSFRX.cpp
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#define WANT_DEBUG
|
#define WANT_DEBUG
|
||||||
|
|
||||||
// #define DUMP_SAMPLES
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "YSFRX.h"
|
#include "YSFRX.h"
|
||||||
|
@ -201,9 +199,6 @@ void CYSFRX::processData(q15_t sample)
|
||||||
} else {
|
} else {
|
||||||
frame[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
frame[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||||
writeRSSIData(frame);
|
writeRSSIData(frame);
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
writeSamples(m_startPtr, frame[0U]);
|
|
||||||
#endif
|
|
||||||
m_maxCorr = 0;
|
m_maxCorr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,20 +404,3 @@ void CYSFRX::writeRSSIData(uint8_t* data)
|
||||||
m_rssiAccum = 0U;
|
m_rssiAccum = 0U;
|
||||||
m_rssiCount = 0U;
|
m_rssiCount = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DUMP_SAMPLES)
|
|
||||||
void CYSFRX::writeSamples(uint16_t start, uint8_t control)
|
|
||||||
{
|
|
||||||
q15_t samples[YSF_FRAME_LENGTH_SYMBOLS];
|
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < YSF_FRAME_LENGTH_SYMBOLS; i++) {
|
|
||||||
samples[i] = m_buffer[start];
|
|
||||||
|
|
||||||
start += YSF_RADIO_SYMBOL_LENGTH;
|
|
||||||
if (start >= YSF_FRAME_LENGTH_SAMPLES)
|
|
||||||
start -= YSF_FRAME_LENGTH_SAMPLES;
|
|
||||||
}
|
|
||||||
|
|
||||||
serial.writeSamples(STATE_YSF, control, samples, YSF_FRAME_LENGTH_SYMBOLS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
1
YSFRX.h
1
YSFRX.h
|
@ -63,7 +63,6 @@ private:
|
||||||
void calculateLevels(uint16_t start, uint16_t count);
|
void calculateLevels(uint16_t start, uint16_t count);
|
||||||
void samplesToBits(uint16_t start, uint16_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
void samplesToBits(uint16_t start, uint16_t count, uint8_t* buffer, uint16_t offset, q15_t centre, q15_t threshold);
|
||||||
void writeRSSIData(uint8_t* data);
|
void writeRSSIData(uint8_t* data);
|
||||||
void writeSamples(uint16_t start, uint8_t control);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue