mirror of https://github.com/g4klx/MMDVM.git
commit
85acdc7121
21
FM.cpp
21
FM.cpp
|
@ -129,25 +129,8 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
|
|||
|
||||
void CFM::process()
|
||||
{
|
||||
if (m_modemState != STATE_FM)
|
||||
return;
|
||||
|
||||
uint16_t length = m_outputRB.getData();
|
||||
if (length == 0U)
|
||||
return;
|
||||
|
||||
uint16_t space = io.getSpace();
|
||||
if (space < 3U)
|
||||
return;
|
||||
|
||||
space -= 2U;
|
||||
|
||||
if (space < length)
|
||||
length = space;
|
||||
|
||||
for (uint16_t i = 0U; i < length; i++) {
|
||||
q15_t sample;
|
||||
m_outputRB.get(sample);
|
||||
while(io.getSpace() >= 3U && m_outputRB.get(sample)) {
|
||||
io.write(STATE_FM, &sample, 1U);
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +234,7 @@ void CFM::stateMachine(bool validSignal)
|
|||
}
|
||||
|
||||
if (m_state == FS_LISTENING && m_modemState == STATE_FM) {
|
||||
if (!m_callsign.isRunning() && !m_rfAck.isRunning() && m_outputRB.getData() == 0U) {
|
||||
if (!m_callsign.isRunning() && !m_rfAck.isRunning()) {
|
||||
DEBUG1("Change to STATE_IDLE");
|
||||
m_modemState = STATE_IDLE;
|
||||
m_callsignTimer.stop();
|
||||
|
|
Loading…
Reference in New Issue