mirror of https://github.com/g4klx/MMDVM.git
Rescale for the increased sample rate.
This commit is contained in:
parent
1ab0cc84a9
commit
bfb198dfd8
|
@ -94,7 +94,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
return m_state != DMRRXS_NONE;
|
return m_state != DMRRXS_NONE;
|
||||||
|
|
||||||
// Ensure that the buffer doesn't overflow
|
// Ensure that the buffer doesn't overflow
|
||||||
if (m_dataPtr > m_endPtr || m_dataPtr >= 900U)
|
if (m_dataPtr > m_endPtr || m_dataPtr >= 1900U)
|
||||||
return m_state != DMRRXS_NONE;
|
return m_state != DMRRXS_NONE;
|
||||||
|
|
||||||
m_buffer[m_dataPtr] = sample;
|
m_buffer[m_dataPtr] = sample;
|
||||||
|
@ -104,7 +104,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
m_bitBuffer[m_bitPtr] |= 0x01U;
|
m_bitBuffer[m_bitPtr] |= 0x01U;
|
||||||
|
|
||||||
if (m_state == DMRRXS_NONE) {
|
if (m_state == DMRRXS_NONE) {
|
||||||
if (m_dataPtr >= 420U && m_dataPtr <= 500U)
|
if (m_dataPtr >= 840U && m_dataPtr <= 1000U)
|
||||||
correlateSync();
|
correlateSync();
|
||||||
} else {
|
} else {
|
||||||
uint16_t min = m_syncPtr - 2U;
|
uint16_t min = m_syncPtr - 2U;
|
||||||
|
@ -128,7 +128,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
slotType.decode(frame + 1U, colorCode, dataType);
|
slotType.decode(frame + 1U, colorCode, dataType);
|
||||||
|
|
||||||
if (colorCode == m_colorCode) {
|
if (colorCode == m_colorCode) {
|
||||||
DEBUG5("DMRSlotRX: data sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, int16_t(m_dataPtr) - 420, m_centre, m_threshold);
|
DEBUG5("DMRSlotRX: data sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, int16_t(m_dataPtr) - 840, m_centre, m_threshold);
|
||||||
|
|
||||||
m_syncCount = 0U;
|
m_syncCount = 0U;
|
||||||
m_n = 0U;
|
m_n = 0U;
|
||||||
|
@ -174,7 +174,7 @@ bool CDMRSlotRX::processSample(q15_t sample)
|
||||||
}
|
}
|
||||||
} else if (m_control == CONTROL_VOICE) {
|
} else if (m_control == CONTROL_VOICE) {
|
||||||
// Voice sync
|
// Voice sync
|
||||||
DEBUG5("DMRSlotRX: voice sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, int16_t(m_dataPtr) - 420, m_centre, m_threshold);
|
DEBUG5("DMRSlotRX: voice sync found slot/pos/centre/threshold", m_slot ? 2U : 1U, int16_t(m_dataPtr) - 840, m_centre, m_threshold);
|
||||||
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||||
m_state = DMRRXS_VOICE;
|
m_state = DMRRXS_VOICE;
|
||||||
m_syncCount = 0U;
|
m_syncCount = 0U;
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
private:
|
private:
|
||||||
bool m_slot;
|
bool m_slot;
|
||||||
uint32_t m_bitBuffer[DMR_RADIO_SYMBOL_LENGTH];
|
uint32_t m_bitBuffer[DMR_RADIO_SYMBOL_LENGTH];
|
||||||
q15_t m_buffer[900U];
|
q15_t m_buffer[1900U];
|
||||||
uint16_t m_bitPtr;
|
uint16_t m_bitPtr;
|
||||||
uint16_t m_dataPtr;
|
uint16_t m_dataPtr;
|
||||||
uint16_t m_syncPtr;
|
uint16_t m_syncPtr;
|
||||||
|
|
Loading…
Reference in New Issue