mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Merge pull request #280 from F4FXL/FM_Ext
Fix Callsign at end and simplify Samples
This commit is contained in:
commit
5039dfbe68
3 changed files with 10 additions and 5 deletions
8
FM.cpp
8
FM.cpp
|
|
@ -97,10 +97,8 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length)
|
|||
//we had enough samples for CTCSS and we are in some other mode than FM
|
||||
bool validCTCSS = CTCSS_VALID(ctcssState);
|
||||
stateMachine(validCTCSS && cos, inputExt);
|
||||
} else if ((inputExt || CTCSS_READY(ctcssState)) && m_modemState == STATE_FM) {
|
||||
//We had enough samples for CTCSS and we are in FM mode, trigger the state machine
|
||||
bool validCTCSS = CTCSS_VALID(ctcssState);
|
||||
stateMachine(validCTCSS && cos, inputExt);
|
||||
if (m_modemState != STATE_FM)
|
||||
continue;
|
||||
} else if ((inputExt || CTCSS_NOT_READY(ctcssState)) && m_modemState == STATE_FM && i == length - 1) {
|
||||
//Not enough samples for CTCSS but we already are in FM, trigger the state machine
|
||||
//but do not trigger the state machine on every single sample, save CPU!
|
||||
|
|
@ -318,7 +316,7 @@ void CFM::stateMachine(bool validRFSignal, bool validExtSignal)
|
|||
break;
|
||||
}
|
||||
|
||||
if (m_state == FS_LISTENING) {
|
||||
if (m_state == FS_LISTENING && !m_rfAck.isWanted() && !m_extAck.isWanted() && !m_callsign.isWanted()) {
|
||||
m_outputRFRB.reset();
|
||||
m_downsampler.reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,6 +205,11 @@ void CFMKeyer::stop()
|
|||
m_audioPos = 0U;
|
||||
}
|
||||
|
||||
bool CFMKeyer::isWanted() const
|
||||
{
|
||||
return m_wanted;
|
||||
}
|
||||
|
||||
bool CFMKeyer::isRunning() const
|
||||
{
|
||||
return m_poPos > 0U || m_dotPos > 0U || m_audioPos > 0U;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
bool isRunning() const;
|
||||
|
||||
bool isWanted() const;
|
||||
|
||||
private:
|
||||
bool m_wanted;
|
||||
uint8_t m_poBuffer[1000U];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue