mirror of https://github.com/g4klx/MMDVM.git
Add DCD LED control.
This commit is contained in:
parent
843997ccad
commit
f1d6a8b36e
|
@ -177,14 +177,12 @@ bool CAX25Demodulator::PLL(bool input)
|
||||||
float32_t jitter;
|
float32_t jitter;
|
||||||
::arm_fir_f32(&m_pllFilter, &offset, &jitter, 1U);
|
::arm_fir_f32(&m_pllFilter, &offset, &jitter, 1U);
|
||||||
|
|
||||||
if (!m_duplex) {
|
|
||||||
float32_t absOffset = adjust;
|
float32_t absOffset = adjust;
|
||||||
if (offset < 0.0F)
|
if (offset < 0.0F)
|
||||||
absOffset -= offset;
|
absOffset -= offset;
|
||||||
else
|
else
|
||||||
absOffset += offset;
|
absOffset += offset;
|
||||||
m_pllJitter = iir(absOffset);
|
m_pllJitter = iir(absOffset);
|
||||||
}
|
|
||||||
|
|
||||||
m_pllCount -= jitter / 2.0F;
|
m_pllCount -= jitter / 2.0F;
|
||||||
m_pllBits = 1U;
|
m_pllBits = 1U;
|
||||||
|
|
18
AX25RX.cpp
18
AX25RX.cpp
|
@ -69,6 +69,7 @@ m_count(0U),
|
||||||
m_slotTime(30U),
|
m_slotTime(30U),
|
||||||
m_slotCount(0U),
|
m_slotCount(0U),
|
||||||
m_pPersist(128U),
|
m_pPersist(128U),
|
||||||
|
m_dcd(false),
|
||||||
m_canTX(false),
|
m_canTX(false),
|
||||||
m_x(1U),
|
m_x(1U),
|
||||||
m_a(0xB7U),
|
m_a(0xB7U),
|
||||||
|
@ -121,7 +122,6 @@ void CAX25RX::samples(q15_t* samples, uint8_t length)
|
||||||
DEBUG1("Decoder 3 reported");
|
DEBUG1("Decoder 3 reported");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_duplex) {
|
|
||||||
m_slotCount += RX_BLOCK_SIZE;
|
m_slotCount += RX_BLOCK_SIZE;
|
||||||
if (m_slotCount >= m_slotTime) {
|
if (m_slotCount >= m_slotTime) {
|
||||||
m_slotCount = 0U;
|
m_slotCount = 0U;
|
||||||
|
@ -130,9 +130,21 @@ void CAX25RX::samples(q15_t* samples, uint8_t length)
|
||||||
bool dcd2 = m_demod2.isDCD();
|
bool dcd2 = m_demod2.isDCD();
|
||||||
bool dcd3 = m_demod3.isDCD();
|
bool dcd3 = m_demod3.isDCD();
|
||||||
|
|
||||||
if (dcd1 || dcd2 || dcd3)
|
if (dcd1 || dcd2 || dcd3) {
|
||||||
|
if (!m_dcd) {
|
||||||
|
io.setDecode(true);
|
||||||
|
io.setADCDetection(true);
|
||||||
|
m_dcd = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_canTX = false;
|
m_canTX = false;
|
||||||
else
|
} else {
|
||||||
|
if (m_dcd) {
|
||||||
|
io.setDecode(false);
|
||||||
|
io.setADCDetection(false);
|
||||||
|
m_dcd = false;
|
||||||
|
}
|
||||||
|
|
||||||
m_canTX = m_pPersist >= rand();
|
m_canTX = m_pPersist >= rand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue