Rename the Goertzel class to CTCSSRX.

This commit is contained in:
Jonathan Naylor 2020-04-18 13:55:34 +01:00
parent 8ca756ec22
commit c55002534e
4 changed files with 22 additions and 18 deletions

14
FM.cpp
View File

@ -44,8 +44,8 @@ m_filter(),
m_filterState(),
m_callsign(),
m_rfAck(),
m_goertzel(),
m_ctcss(),
m_ctcssRX(),
m_ctcssTX(),
m_timeoutTone(),
m_state(FS_LISTENING),
m_callsignAtStart(false),
@ -67,7 +67,7 @@ m_hangTimer()
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);
@ -92,7 +92,7 @@ void CFM::samples(q15_t* samples, uint8_t length)
q15_t output[RX_BLOCK_SIZE];
::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);
}
@ -137,9 +137,11 @@ uint8_t CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFreque
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)

6
FM.h
View File

@ -21,7 +21,7 @@
#include "Config.h"
#include "FMGoertzel.h"
#include "FMCTCSSRX.h"
#include "FMCTCSSTX.h"
#include "FMTimeout.h"
#include "FMKeyer.h"
@ -56,8 +56,8 @@ private:
q15_t m_filterState[230U]; // NoTaps + BlockSize - 1, 201 + 20 - 1 plus some spare
CFMKeyer m_callsign;
CFMKeyer m_rfAck;
CFMGoertzel m_goertzel;
CFMCTCSSTX m_ctcss;
CFMCTCSSRX m_ctcssRX;
CFMCTCSSTX m_ctcssTX;
CFMTimeout m_timeoutTone;
FM_STATE m_state;
bool m_callsignAtStart;

View File

@ -18,16 +18,18 @@
#include "Config.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;
}

View File

@ -16,16 +16,16 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(FMGoertzel_H)
#define FMGoertzel_H
#if !defined(FMCTCSSRX_H)
#define FMCTCSSRX_H
#include "Config.h"
class CFMGoertzel {
class CFMCTCSSRX {
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);