Add fine adjustment to the DMR/YSF thresholds.

This commit is contained in:
Jonathan Naylor 2016-06-21 07:25:25 +01:00
parent a3ea870b52
commit 17f6314f90
9 changed files with 83 additions and 8 deletions

View file

@ -185,7 +185,7 @@ void CSerialPort::getVersion()
uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
{
if (length < 14U)
if (length < 16U)
return 4U;
bool rxInvert = (data[0U] & 0x01U) == 0x01U;
@ -240,6 +240,9 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
int8_t ysfLevel1 = int8_t(data[12U]) - 128;
int8_t ysfLevel3 = int8_t(data[13U]) - 128;
int8_t dmrThreshold = int8_t(data[14U]) - 128;
int8_t ysfThreshold = int8_t(data[15U]) - 128;
m_modemState = modemState;
m_dstarEnable = dstarEnable;
@ -258,6 +261,10 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
dmrTX.setLevels(dmrLevel1, dmrLevel3);
ysfTX.setLevels(ysfLevel1, ysfLevel3);
dmrIdleRX.setThreshold(dmrThreshold);
dmrRX.setThreshold(dmrThreshold);
ysfRX.setThreshold(ysfThreshold);
io.setParameters(rxInvert, txInvert, pttInvert, rxLevel, txLevel);
io.start();