mirror of https://github.com/markqvist/MMDVM.git
Start handling data frames and restrict sync detection range for DMR.
parent
25db67eb5a
commit
de908a83c1
|
@ -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
|
* 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
|
* 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_VOICE_LC_HEADER = 1U;
|
||||||
const uint8_t DT_TERMINATOR_WITH_LC = 2U;
|
const uint8_t DT_TERMINATOR_WITH_LC = 2U;
|
||||||
const uint8_t DT_CSBK = 3U;
|
const uint8_t DT_CSBK = 3U;
|
||||||
|
const uint8_t DT_DATA_HEADER = 6U;
|
||||||
const uint8_t DT_IDLE = 9U;
|
const uint8_t DT_IDLE = 9U;
|
||||||
// All others are for data transfer
|
// All others are for data transfer
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
|
|
||||||
// The approximate position of the sync samples, XXX to be updated later
|
// The approximate position of the sync samples, XXX to be updated later
|
||||||
// XXX change range when m_endPtr is set, make it tighter.
|
// 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);
|
correlateSync(sample);
|
||||||
|
|
||||||
if (m_dataPtr == m_endPtr) {
|
if (m_dataPtr == m_endPtr) {
|
||||||
|
@ -118,15 +118,10 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
frame[0U] |= dataType;
|
frame[0U] |= dataType;
|
||||||
|
|
||||||
switch (dataType) {
|
switch (dataType) {
|
||||||
|
case DT_DATA_HEADER:
|
||||||
case DT_VOICE_LC_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:
|
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_receiving = true;
|
||||||
m_syncCount = 0U;
|
m_syncCount = 0U;
|
||||||
m_n = 0U;
|
m_n = 0U;
|
||||||
|
|
|
@ -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.
|
System Fusion.
|
||||||
|
|
||||||
Currently it only runs on the Arduino Due, but other platforms are planned.
|
Currently it only runs on the Arduino Due, but other platforms are planned.
|
||||||
|
|
|
@ -56,7 +56,7 @@ const uint8_t MMDVM_DEBUG4 = 0xF4U;
|
||||||
const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
||||||
const uint8_t MMDVM_SAMPLES = 0xF8U;
|
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;
|
const uint8_t PROTOCOL_VERSION = 1U;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue