Start handling data frames and restrict sync detection range for DMR.

48kHz
Jonathan Naylor 2016-01-15 06:10:54 +00:00
parent 25db67eb5a
commit de908a83c1
4 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
* Copyright (C) 2009-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
@ -75,6 +75,7 @@ const uint8_t DT_VOICE_PI_HEADER = 0U;
const uint8_t DT_VOICE_LC_HEADER = 1U;
const uint8_t DT_TERMINATOR_WITH_LC = 2U;
const uint8_t DT_CSBK = 3U;
const uint8_t DT_DATA_HEADER = 6U;
const uint8_t DT_IDLE = 9U;
// All others are for data transfer

View File

@ -98,7 +98,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
// The approximate position of the sync samples, XXX to be updated later
// XXX change range when m_endPtr is set, make it tighter.
if (m_dataPtr >= 160U && m_dataPtr <= 530U)
if (m_dataPtr >= 375U && m_dataPtr <= 530U)
correlateSync(sample);
if (m_dataPtr == m_endPtr) {
@ -118,15 +118,10 @@ bool CDMRSlotRX::processSample(q15_t sample)
frame[0U] |= dataType;
switch (dataType) {
case DT_DATA_HEADER:
case DT_VOICE_LC_HEADER:
DEBUG3("DMRSlotRX: LC header for slot with color code", m_slot ? 2U : 1U, colorCode);
m_receiving = true;
m_syncCount = 0U;
m_n = 0U;
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
break;
case DT_VOICE_PI_HEADER:
DEBUG3("DMRSlotRX: PI header for slot with color code", m_slot ? 2U : 1U, colorCode);
DEBUG4("DMRSlotRX: header for slot with color code/data type", m_slot ? 2U : 1U, colorCode, dataType);
m_receiving = true;
m_syncCount = 0U;
m_n = 0U;

View File

@ -1,4 +1,4 @@
This is the source code of the MMDVM firmware that supports D-Star, DMR< and
This is the source code of the MMDVM firmware that supports D-Star, DMR, and
System Fusion.
Currently it only runs on the Arduino Due, but other platforms are planned.

View File

@ -56,7 +56,7 @@ const uint8_t MMDVM_DEBUG4 = 0xF4U;
const uint8_t MMDVM_DEBUG5 = 0xF5U;
const uint8_t MMDVM_SAMPLES = 0xF8U;
const uint8_t HARDWARE[] = "MMDVM 20160114 (D-Star/DMR/System Fusion)";
const uint8_t HARDWARE[] = "MMDVM 20160115 (D-Star/DMR/System Fusion)";
const uint8_t PROTOCOL_VERSION = 1U;