Merge branch 'FM' into FM_Ext

This commit is contained in:
Jonathan Naylor
2020-05-12 16:24:42 +01:00
7 changed files with 78 additions and 58 deletions

View File

@@ -195,7 +195,8 @@ m_fmAckLevel(80.0F),
m_fmTimeout(120U),
m_fmTimeoutLevel(80.0F),
m_fmCtcssFrequency(88.4F),
m_fmCtcssThreshold(25U),
m_fmCtcssHighThreshold(30U),
m_fmCtcssLowThreshold(20U),
m_fmCtcssLevel(10.0F),
m_fmKerchunkTime(0U),
m_fmHangTime(5U),
@@ -2021,14 +2022,15 @@ 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, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
{
m_fmTimeout = timeout;
m_fmTimeoutLevel = timeoutLevel;
m_fmCtcssFrequency = ctcssFrequency;
m_fmCtcssThreshold = ctcssThreshold;
m_fmCtcssLevel = ctcssLevel;
m_fmCtcssFrequency = ctcssFrequency;
m_fmCtcssHighThreshold = ctcssHighThreshold;
m_fmCtcssLowThreshold = ctcssLowThreshold;
m_fmCtcssLevel = ctcssLevel;
m_fmKerchunkTime = kerchunkTime;
m_fmHangTime = hangTime;
@@ -2167,35 +2169,36 @@ bool CModem::setFMMiscParams()
unsigned char buffer[20U];
buffer[0U] = MMDVM_FRAME_START;
buffer[1U] = 14U;
buffer[1U] = 15U;
buffer[2U] = MMDVM_FM_PARAMS3;
buffer[3U] = m_fmTimeout / 5U;
buffer[4U] = (unsigned char)(m_fmTimeoutLevel * 2.55F + 0.5F);
buffer[5U] = (unsigned char)m_fmCtcssFrequency;
buffer[6U] = m_fmCtcssThreshold;
buffer[7U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
buffer[6U] = m_fmCtcssHighThreshold;
buffer[7U] = m_fmCtcssLowThreshold;
buffer[8U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
buffer[8U] = m_fmKerchunkTime;
buffer[9U] = m_fmHangTime;
buffer[9U] = m_fmKerchunkTime;
buffer[10U] = m_fmHangTime;
buffer[10U] = 0x00U;
buffer[11U] = 0x00U;
if (m_fmUseCOS)
buffer[10U] |= 0x01U;
buffer[11U] |= 0x01U;
if (m_fmCOSInvert)
buffer[10U] |= 0x02U;
buffer[11U] |= 0x02U;
buffer[11U] = m_fmRFAudioBoost;
buffer[12U] = m_fmRFAudioBoost;
buffer[12U] = (unsigned char)(m_fmMaxDevLevel * 2.55F + 0.5F);
buffer[13U] = (unsigned char)(m_fmMaxDevLevel * 2.55F + 0.5F);
buffer[13U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F);
buffer[14U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F);
// CUtils::dump(1U, "Written", buffer, 14U);
// CUtils::dump(1U, "Written", buffer, 15U);
int ret = m_serial->write(buffer, 14U);
if (ret != 14)
int ret = m_serial->write(buffer, 15U);
if (ret != 15)
return false;
unsigned int count = 0U;