mirror of https://github.com/g4klx/MMDVM.git
Rename the Goertzel class to CTCSSRX.
This commit is contained in:
parent
8ca756ec22
commit
c55002534e
14
FM.cpp
14
FM.cpp
|
@ -44,8 +44,8 @@ m_filter(),
|
||||||
m_filterState(),
|
m_filterState(),
|
||||||
m_callsign(),
|
m_callsign(),
|
||||||
m_rfAck(),
|
m_rfAck(),
|
||||||
m_goertzel(),
|
m_ctcssRX(),
|
||||||
m_ctcss(),
|
m_ctcssTX(),
|
||||||
m_timeoutTone(),
|
m_timeoutTone(),
|
||||||
m_state(FS_LISTENING),
|
m_state(FS_LISTENING),
|
||||||
m_callsignAtStart(false),
|
m_callsignAtStart(false),
|
||||||
|
@ -67,7 +67,7 @@ m_hangTimer()
|
||||||
|
|
||||||
void CFM::samples(q15_t* samples, uint8_t length)
|
void CFM::samples(q15_t* samples, uint8_t length)
|
||||||
{
|
{
|
||||||
bool validSignal = m_goertzel.process(samples, length);
|
bool validSignal = m_ctcssRX.process(samples, length);
|
||||||
|
|
||||||
stateMachine(validSignal, length);
|
stateMachine(validSignal, length);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void CFM::samples(q15_t* samples, uint8_t length)
|
||||||
q15_t output[RX_BLOCK_SIZE];
|
q15_t output[RX_BLOCK_SIZE];
|
||||||
::arm_fir_fast_q15(&m_filter, samples, output, length);
|
::arm_fir_fast_q15(&m_filter, samples, output, length);
|
||||||
|
|
||||||
m_ctcss.getAudio(output, length);
|
m_ctcssTX.getAudio(output, length);
|
||||||
|
|
||||||
io.write(STATE_FM, output, length);
|
io.write(STATE_FM, output, length);
|
||||||
}
|
}
|
||||||
|
@ -137,9 +137,11 @@ uint8_t CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFreque
|
||||||
|
|
||||||
m_timeoutTone.setParams(timeoutLevel);
|
m_timeoutTone.setParams(timeoutLevel);
|
||||||
|
|
||||||
m_goertzel.setParams(ctcssFrequency, ctcssThreshold);
|
uint8_t ret = m_ctcssRX.setParams(ctcssFrequency, ctcssThreshold);
|
||||||
|
if (ret != 0U)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return m_ctcss.setParams(ctcssFrequency, ctcssLevel);
|
return m_ctcssTX.setParams(ctcssFrequency, ctcssLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFM::stateMachine(bool validSignal, uint8_t length)
|
void CFM::stateMachine(bool validSignal, uint8_t length)
|
||||||
|
|
6
FM.h
6
FM.h
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
#include "FMGoertzel.h"
|
#include "FMCTCSSRX.h"
|
||||||
#include "FMCTCSSTX.h"
|
#include "FMCTCSSTX.h"
|
||||||
#include "FMTimeout.h"
|
#include "FMTimeout.h"
|
||||||
#include "FMKeyer.h"
|
#include "FMKeyer.h"
|
||||||
|
@ -56,8 +56,8 @@ private:
|
||||||
q15_t m_filterState[230U]; // NoTaps + BlockSize - 1, 201 + 20 - 1 plus some spare
|
q15_t m_filterState[230U]; // NoTaps + BlockSize - 1, 201 + 20 - 1 plus some spare
|
||||||
CFMKeyer m_callsign;
|
CFMKeyer m_callsign;
|
||||||
CFMKeyer m_rfAck;
|
CFMKeyer m_rfAck;
|
||||||
CFMGoertzel m_goertzel;
|
CFMCTCSSRX m_ctcssRX;
|
||||||
CFMCTCSSTX m_ctcss;
|
CFMCTCSSTX m_ctcssTX;
|
||||||
CFMTimeout m_timeoutTone;
|
CFMTimeout m_timeoutTone;
|
||||||
FM_STATE m_state;
|
FM_STATE m_state;
|
||||||
bool m_callsignAtStart;
|
bool m_callsignAtStart;
|
||||||
|
|
|
@ -18,16 +18,18 @@
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "FMGoertzel.h"
|
#include "FMCTCSSRX.h"
|
||||||
|
|
||||||
CFMGoertzel::CFMGoertzel()
|
CFMCTCSSRX::CFMCTCSSRX()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFMGoertzel::setParams(uint8_t frequency, uint8_t threshold)
|
uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold)
|
||||||
{
|
{
|
||||||
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFMGoertzel::process(const q15_t* samples, uint8_t length)
|
bool CFMCTCSSRX::process(const q15_t* samples, uint8_t length)
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
|
@ -16,16 +16,16 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(FMGoertzel_H)
|
#if !defined(FMCTCSSRX_H)
|
||||||
#define FMGoertzel_H
|
#define FMCTCSSRX_H
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
class CFMGoertzel {
|
class CFMCTCSSRX {
|
||||||
public:
|
public:
|
||||||
CFMGoertzel();
|
CFMCTCSSRX();
|
||||||
|
|
||||||
void setParams(uint8_t frequency, uint8_t threshold);
|
uint8_t setParams(uint8_t frequency, uint8_t threshold);
|
||||||
|
|
||||||
bool process(const q15_t* samples, uint8_t length);
|
bool process(const q15_t* samples, uint8_t length);
|
||||||
|
|
Loading…
Reference in New Issue