diff --git a/Conf.cpp b/Conf.cpp index 1663d48..c964b61 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -192,7 +192,7 @@ m_fmAckLevel(80.0F), m_fmTimeout(180U), m_fmTimeoutLevel(80.0F), m_fmCTCSSFrequency(88.6F), -m_fmCTCSSThreshold(10.0F), +m_fmCTCSSThreshold(25U), m_fmCTCSSLevel(5.0F), m_fmKerchunkTime(0U), m_fmHangTime(7U), @@ -739,7 +739,7 @@ bool CConf::read() else if (::strcmp(key, "CTCSSFrequency") == 0) m_fmCTCSSFrequency = float(::atof(value)); else if (::strcmp(key, "CTCSSThreshold") == 0) - m_fmCTCSSThreshold = float(::atoi(value)); + m_fmCTCSSThreshold = (unsigned int)::atoi(value); else if (::strcmp(key, "CTCSSLevel") == 0) m_fmCTCSSLevel = float(::atof(value)); else if (::strcmp(key, "KerchunkTime") == 0) @@ -1583,7 +1583,7 @@ float CConf::getFMCTCSSFrequency() const return m_fmCTCSSFrequency; } -float CConf::getFMCTCSSThreshold() const +unsigned int CConf::getFMCTCSSThreshold() const { return m_fmCTCSSThreshold; } diff --git a/Conf.h b/Conf.h index af882a2..df6a581 100644 --- a/Conf.h +++ b/Conf.h @@ -190,7 +190,7 @@ public: unsigned int getFMTimeout() const; float getFMTimeoutLevel() const; float getFMCTCSSFrequency() const; - float getFMCTCSSThreshold() const; + unsigned int getFMCTCSSThreshold() const; float getFMCTCSSLevel() const; unsigned int getFMKerchunkTime() const; unsigned int getFMHangTime() const; @@ -451,7 +451,7 @@ private: unsigned int m_fmTimeout; float m_fmTimeoutLevel; float m_fmCTCSSFrequency; - float m_fmCTCSSThreshold; + unsigned int m_fmCTCSSThreshold; float m_fmCTCSSLevel; unsigned int m_fmKerchunkTime; unsigned int m_fmHangTime; diff --git a/MMDVM.ini b/MMDVM.ini index c8a5403..b9a1220 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -160,7 +160,7 @@ AckLevel=80 # Timeout=180 TimeoutLevel=80 CTCSSFrequency=88.8 -CTCSSThreshold=10 +CTCSSThreshold=25 CTCSSLevel=5 KerchunkTime=0 HangTime=7 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index bddfd65..9246195 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1226,7 +1226,7 @@ bool CMMDVMHost::createModem() unsigned int timeout = m_conf.getFMTimeout(); float timeoutLevel = m_conf.getFMTimeoutLevel(); float ctcssFrequency = m_conf.getFMCTCSSFrequency(); - float ctcssThreshold = m_conf.getFMCTCSSThreshold(); + unsigned int ctcssThreshold = m_conf.getFMCTCSSThreshold(); float ctcssLevel = m_conf.getFMCTCSSLevel(); unsigned int kerchunkTime = m_conf.getFMKerchunkTime(); unsigned int hangTime = m_conf.getFMHangTime(); @@ -1250,7 +1250,7 @@ bool CMMDVMHost::createModem() LogInfo(" Timeout: %us", timeout); LogInfo(" Timeout Level: %.1f%%", timeoutLevel); LogInfo(" CTCSS Frequency: %.1fHz", ctcssFrequency); - LogInfo(" CTCSS Threshold: %.1f%%", ctcssThreshold); + LogInfo(" CTCSS Threshold: %u", ctcssThreshold); LogInfo(" CTCSS Level: %.1f%%", ctcssLevel); LogInfo(" Kerchunk Time: %us", kerchunkTime); LogInfo(" Hang Time: %us", hangTime); diff --git a/Modem.cpp b/Modem.cpp index df2c9c5..f443cec 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -187,7 +187,7 @@ m_fmAckLevel(80.0F), m_fmTimeout(120U), m_fmTimeoutLevel(80.0F), m_fmCtcssFrequency(88.4F), -m_fmCtcssThreshold(10.0F), +m_fmCtcssThreshold(25U), m_fmCtcssLevel(10.0F), m_fmKerchunkTime(0U), m_fmHangTime(5U) @@ -1903,7 +1903,7 @@ void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, uns m_fmAckLevel = ackLevel; } -void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, float ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime) +void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime) { m_fmTimeout = timeout; m_fmTimeoutLevel = timeoutLevel; @@ -2040,7 +2040,7 @@ bool CModem::setFMMiscParams() buffer[4U] = (unsigned char)(m_fmTimeoutLevel * 2.55F + 0.5F); buffer[5U] = (unsigned char)m_fmCtcssFrequency; - buffer[6U] = (unsigned char)(m_fmCtcssThreshold * 2.55F + 0.5F); + buffer[6U] = m_fmCtcssThreshold; buffer[7U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F); buffer[8U] = m_fmKerchunkTime; diff --git a/Modem.h b/Modem.h index fdca2e3..a4181cd 100644 --- a/Modem.h +++ b/Modem.h @@ -47,7 +47,7 @@ public: virtual void setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignLevel, bool callsignAtStart, bool callsignAtEnd); virtual void setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel); - virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, float ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime); + virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime); virtual bool open(); @@ -202,7 +202,7 @@ private: unsigned int m_fmTimeout; float m_fmTimeoutLevel; float m_fmCtcssFrequency; - float m_fmCtcssThreshold; + unsigned int m_fmCtcssThreshold; float m_fmCtcssLevel; unsigned int m_fmKerchunkTime; unsigned int m_fmHangTime; diff --git a/Version.h b/Version.h index 4029d27..5532a2c 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20200419"; +const char* VERSION = "20200420"; #endif