Release to STATE_IDLE under simpler conditions.

This commit is contained in:
Jonathan Naylor 2020-05-10 21:25:10 +01:00
parent c91a42f53d
commit 89458a2c93
1 changed files with 11 additions and 15 deletions

8
FM.cpp
View File

@ -117,8 +117,6 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
currentBoost = m_extAudioBoost; currentBoost = m_extAudioBoost;
} }
// Only let RF audio through when relaying RF audio // Only let RF audio through when relaying RF audio
if (m_state == FS_RELAYING_RF || m_state == FS_KERCHUNK_RF || m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT) { if (m_state == FS_RELAYING_RF || m_state == FS_KERCHUNK_RF || m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT) {
currentSample = m_blanking.process(currentSample); currentSample = m_blanking.process(currentSample);
@ -159,12 +157,12 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
void CFM::process() void CFM::process()
{ {
q15_t sample; q15_t sample;
while(io.getSpace() >= 3U && m_outputRFRB.get(sample)) while (io.getSpace() >= 3U && m_outputRFRB.get(sample))
io.write(STATE_FM, &sample, 1U); io.write(STATE_FM, &sample, 1U);
uint8_t serialSample; uint8_t serialSample;
//write data to serial port //write data to serial port
while(m_downsampler.getPackedData(serialSample)) while (m_downsampler.getPackedData(serialSample))
serial.writeFMData(&serialSample, 1U); serial.writeFMData(&serialSample, 1U);
} }
@ -295,7 +293,6 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal)
} }
if (m_state == FS_LISTENING && m_modemState == STATE_FM) { if (m_state == FS_LISTENING && m_modemState == STATE_FM) {
if (!m_callsign.isRunning() && !m_rfAck.isRunning() && !m_extAck.isRunning()) {
DEBUG1("Change to STATE_IDLE"); DEBUG1("Change to STATE_IDLE");
m_modemState = STATE_IDLE; m_modemState = STATE_IDLE;
m_callsignTimer.stop(); m_callsignTimer.stop();
@ -305,7 +302,6 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal)
m_ackDelayTimer.stop(); m_ackDelayTimer.stop();
m_hangTimer.stop(); m_hangTimer.stop();
} }
}
} }
void CFM::clock(uint8_t length) void CFM::clock(uint8_t length)