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;
|
||||
::arm_fir_f32(&m_pllFilter, &offset, &jitter, 1U);
|
||||
|
||||
if (!m_duplex) {
|
||||
float32_t absOffset = adjust;
|
||||
if (offset < 0.0F)
|
||||
absOffset -= offset;
|
||||
else
|
||||
absOffset += offset;
|
||||
m_pllJitter = iir(absOffset);
|
||||
}
|
||||
float32_t absOffset = adjust;
|
||||
if (offset < 0.0F)
|
||||
absOffset -= offset;
|
||||
else
|
||||
absOffset += offset;
|
||||
m_pllJitter = iir(absOffset);
|
||||
|
||||
m_pllCount -= jitter / 2.0F;
|
||||
m_pllBits = 1U;
|
||||
|
|
34
AX25RX.cpp
34
AX25RX.cpp
|
@ -69,6 +69,7 @@ m_count(0U),
|
|||
m_slotTime(30U),
|
||||
m_slotCount(0U),
|
||||
m_pPersist(128U),
|
||||
m_dcd(false),
|
||||
m_canTX(false),
|
||||
m_x(1U),
|
||||
m_a(0xB7U),
|
||||
|
@ -121,19 +122,30 @@ void CAX25RX::samples(q15_t* samples, uint8_t length)
|
|||
DEBUG1("Decoder 3 reported");
|
||||
}
|
||||
|
||||
if (!m_duplex) {
|
||||
m_slotCount += RX_BLOCK_SIZE;
|
||||
if (m_slotCount >= m_slotTime) {
|
||||
m_slotCount = 0U;
|
||||
m_slotCount += RX_BLOCK_SIZE;
|
||||
if (m_slotCount >= m_slotTime) {
|
||||
m_slotCount = 0U;
|
||||
|
||||
bool dcd1 = m_demod1.isDCD();
|
||||
bool dcd2 = m_demod2.isDCD();
|
||||
bool dcd3 = m_demod3.isDCD();
|
||||
bool dcd1 = m_demod1.isDCD();
|
||||
bool dcd2 = m_demod2.isDCD();
|
||||
bool dcd3 = m_demod3.isDCD();
|
||||
|
||||
if (dcd1 || dcd2 || dcd3)
|
||||
m_canTX = false;
|
||||
else
|
||||
m_canTX = m_pPersist >= rand();
|
||||
if (dcd1 || dcd2 || dcd3) {
|
||||
if (!m_dcd) {
|
||||
io.setDecode(true);
|
||||
io.setADCDetection(true);
|
||||
m_dcd = true;
|
||||
}
|
||||
|
||||
m_canTX = false;
|
||||
} else {
|
||||
if (m_dcd) {
|
||||
io.setDecode(false);
|
||||
io.setADCDetection(false);
|
||||
m_dcd = false;
|
||||
}
|
||||
|
||||
m_canTX = m_pPersist >= rand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue