mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-04-07 15:36:21 +00:00
Add working sync sample dumping for DMR, P25 and YSF.
This commit is contained in:
parent
f3a3132a6c
commit
ac4249bbb1
6 changed files with 29 additions and 23 deletions
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define WANT_DEBUG
|
||||
|
||||
#define DUMP_SAMPLES
|
||||
// #define DUMP_SAMPLES
|
||||
|
||||
#include "Config.h"
|
||||
#include "Globals.h"
|
||||
|
|
@ -134,7 +134,7 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
|
|||
samplesToBits(ptr, DMR_FRAME_LENGTH_SYMBOLS, frame, 8U, centre, threshold);
|
||||
#if defined(DUMP_SAMPLES)
|
||||
if (m_control == CONTROL_DATA || m_control == CONTROL_VOICE)
|
||||
writeSync(ptr);
|
||||
writeSync();
|
||||
#endif
|
||||
|
||||
if (m_control == CONTROL_DATA) {
|
||||
|
|
@ -394,19 +394,19 @@ void CDMRSlotRX::writeRSSIData(uint8_t* frame)
|
|||
#endif
|
||||
}
|
||||
|
||||
void CDMRSlotRX::writeSync(uint16_t start)
|
||||
#if defined(DUMP_SAMPLES)
|
||||
void CDMRSlotRX::writeSync()
|
||||
{
|
||||
// XXX Check this
|
||||
start += DMR_AUDIO_LENGTH_SYMBOLS / 2U;
|
||||
uint16_t ptr = m_syncPtr - DMR_SYNC_LENGTH_SAMPLES + DMR_RADIO_SYMBOL_LENGTH;
|
||||
|
||||
q15_t sync[DMR_SYNC_LENGTH_SYMBOLS];
|
||||
|
||||
for (uint16_t i = 0U; i < DMR_SYNC_LENGTH_SYMBOLS; i++) {
|
||||
sync[i] = m_buffer[start];
|
||||
|
||||
start += DMR_RADIO_SYMBOL_LENGTH;
|
||||
sync[i] = m_buffer[ptr];
|
||||
ptr += DMR_RADIO_SYMBOL_LENGTH;
|
||||
}
|
||||
|
||||
serial.writeSamples(STATE_DMR, sync, DMR_SYNC_LENGTH_SYMBOLS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue