diff --git a/Conf.cpp b/Conf.cpp index 23f7596..8c07bc6 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -198,6 +198,7 @@ m_fmCTCSSLevel(2.0F), m_fmKerchunkTime(0U), m_fmHangTime(7U), m_fmUseCOS(true), +m_fmCOSInvert(false), m_fmRFAudioBoost(1U), m_fmMaxDevLevel(90.0F), m_fmExtAudioBoost(1U), @@ -755,6 +756,8 @@ bool CConf::read() m_fmHangTime = (unsigned int)::atoi(value); else if (::strcmp(key, "UseCOS") == 0) m_fmUseCOS = ::atoi(value) == 1; + else if (::strcmp(key, "COSInvert") == 0) + m_fmCOSInvert = ::atoi(value) == 1; else if (::strcmp(key, "RFAudioBoost") == 0) m_fmRFAudioBoost = (unsigned int)::atoi(value); else if (::strcmp(key, "MaxDevLevel") == 0) @@ -1628,6 +1631,11 @@ bool CConf::getFMUseCOS() const return m_fmUseCOS; } +bool CConf::getFMCOSInvert() const +{ + return m_fmCOSInvert; +} + unsigned int CConf::getFMRFAudioBoost() const { return m_fmRFAudioBoost; diff --git a/Conf.h b/Conf.h index 0ba0955..f5a40bd 100644 --- a/Conf.h +++ b/Conf.h @@ -196,6 +196,7 @@ public: unsigned int getFMKerchunkTime() const; unsigned int getFMHangTime() const; bool getFMUseCOS() const; + bool getFMCOSInvert() const; unsigned int getFMRFAudioBoost() const; float getFMMaxDevLevel() const; unsigned int getFMExtAudioBoost() const; @@ -462,6 +463,7 @@ private: unsigned int m_fmKerchunkTime; unsigned int m_fmHangTime; bool m_fmUseCOS; + bool m_fmCOSInvert; unsigned int m_fmRFAudioBoost; float m_fmMaxDevLevel; unsigned int m_fmExtAudioBoost; diff --git a/MMDVM.ini b/MMDVM.ini index 9faaecc..5e71a84 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -166,6 +166,7 @@ CTCSSLevel=20 KerchunkTime=0 HangTime=7 UseCOS=1 +COSInvert=0 RFAudioBoost=1 MaxDevLevel=90 ExtAudioBoost=1 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index b3314be..e2a7766 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1231,6 +1231,7 @@ bool CMMDVMHost::createModem() unsigned int kerchunkTime = m_conf.getFMKerchunkTime(); unsigned int hangTime = m_conf.getFMHangTime(); bool useCOS = m_conf.getFMUseCOS(); + bool cosInvert = m_conf.getFMCOSInvert(); unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost(); float maxDevLevel = m_conf.getFMMaxDevLevel(); unsigned int extAudioBoost = m_conf.getFMExtAudioBoost(); @@ -1261,13 +1262,14 @@ bool CMMDVMHost::createModem() LogInfo(" Kerchunk Time: %us", kerchunkTime); LogInfo(" Hang Time: %us", hangTime); LogInfo(" Use COS: %s", useCOS ? "yes" : "no"); + LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no"); LogInfo(" RF Audio Boost: x%u", rfAudioBoost); LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel); // LogInfo(" Ext. Audio Boost: x%u", extAudioBoost); m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch); m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel); - m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, rfAudioBoost, maxDevLevel); + m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel); } bool ret = m_modem->open(); diff --git a/Modem.cpp b/Modem.cpp index 3041567..edbebec 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -193,6 +193,7 @@ m_fmCtcssLevel(10.0F), m_fmKerchunkTime(0U), m_fmHangTime(5U), m_fmUseCOS(true), +m_fmCOSInvert(false), m_fmRFAudioBoost(1U), m_fmMaxDevLevel(90.0F) { @@ -1912,7 +1913,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, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, unsigned int rfAudioBoost, float maxDevLevel) +void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel) { m_fmTimeout = timeout; m_fmTimeoutLevel = timeoutLevel; @@ -1925,6 +1926,8 @@ void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctc m_fmHangTime = hangTime; m_fmUseCOS = useCOS; + m_fmCOSInvert = cosInvert; + m_fmRFAudioBoost = rfAudioBoost; m_fmMaxDevLevel = maxDevLevel; } @@ -2065,6 +2068,8 @@ bool CModem::setFMMiscParams() buffer[10U] = 0x00U; if (m_fmUseCOS) buffer[10U] |= 0x01U; + if (m_fmCOSInvert) + buffer[10U] |= 0x02U; buffer[11U] = m_fmRFAudioBoost; diff --git a/Modem.h b/Modem.h index edb30ec..6404d89 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 callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch); 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, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, unsigned int rfAudioBoost, float maxDevLevel); + virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel); virtual bool open(); @@ -209,6 +209,7 @@ private: unsigned int m_fmKerchunkTime; unsigned int m_fmHangTime; bool m_fmUseCOS; + bool m_fmCOSInvert; unsigned int m_fmRFAudioBoost; float m_fmMaxDevLevel; diff --git a/Version.h b/Version.h index 4b0d9cc..7bf2d5a 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20200504"; +const char* VERSION = "20200506"; #endif