mirror of https://github.com/g4klx/MMDVM.git
Allow for adjustable CW Id levels.
This commit is contained in:
parent
1e0634c0b1
commit
3ef9e40137
|
@ -104,9 +104,9 @@ void CCWIdTX::process()
|
|||
while (space > CYCLE_LENGTH) {
|
||||
bool b = READ_BIT1(m_poBuffer, m_poPtr);
|
||||
if (b)
|
||||
io.write(STATE_DSTAR, TONE, CYCLE_LENGTH);
|
||||
io.write(STATE_CWID, TONE, CYCLE_LENGTH);
|
||||
else
|
||||
io.write(STATE_DSTAR, SILENCE, CYCLE_LENGTH);
|
||||
io.write(STATE_CWID, SILENCE, CYCLE_LENGTH);
|
||||
|
||||
space -= CYCLE_LENGTH;
|
||||
|
||||
|
|
2
Config.h
2
Config.h
|
@ -52,7 +52,7 @@
|
|||
// #define SEND_RSSI_DATA
|
||||
|
||||
// Use the modem as a serial repeater for Nextion displays
|
||||
// #define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@ enum MMDVM_STATE {
|
|||
STATE_DMR = 2,
|
||||
STATE_YSF = 3,
|
||||
STATE_P25 = 4,
|
||||
|
||||
// Dummy states start at 90
|
||||
STATE_CWID = 97,
|
||||
STATE_DMRCAL = 98,
|
||||
STATE_DSTARCAL = 99
|
||||
};
|
||||
|
|
9
IO.cpp
9
IO.cpp
|
@ -125,6 +125,7 @@ m_C4FSKState(),
|
|||
m_GMSKState(),
|
||||
m_pttInvert(false),
|
||||
m_rxLevel(128 * 128),
|
||||
m_cwIdTXLevel(128 * 128),
|
||||
m_dstarTXLevel(128 * 128),
|
||||
m_dmrTXLevel(128 * 128),
|
||||
m_ysfTXLevel(128 * 128),
|
||||
|
@ -434,6 +435,9 @@ void CIO::write(MMDVM_STATE mode, q15_t* samples, uint16_t length, const uint8_t
|
|||
|
||||
q15_t txLevel = 0;
|
||||
switch (mode) {
|
||||
case STATE_DSTAR:
|
||||
txLevel = m_dstarTXLevel;
|
||||
break;
|
||||
case STATE_DMR:
|
||||
txLevel = m_dmrTXLevel;
|
||||
break;
|
||||
|
@ -444,7 +448,7 @@ void CIO::write(MMDVM_STATE mode, q15_t* samples, uint16_t length, const uint8_t
|
|||
txLevel = m_p25TXLevel;
|
||||
break;
|
||||
default:
|
||||
txLevel = m_dstarTXLevel;
|
||||
txLevel = m_cwIdTXLevel;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -546,11 +550,12 @@ switch (m_modemState) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void CIO::setParameters(bool rxInvert, bool txInvert, bool pttInvert, uint8_t rxLevel, uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel)
|
||||
void CIO::setParameters(bool rxInvert, bool txInvert, bool pttInvert, uint8_t rxLevel, uint8_t cwIdTXLevel, uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel)
|
||||
{
|
||||
m_pttInvert = pttInvert;
|
||||
|
||||
m_rxLevel = q15_t(rxLevel * 128);
|
||||
m_cwIdTXLevel = q15_t(cwIdTXLevel * 128);
|
||||
m_dstarTXLevel = q15_t(dstarTXLevel * 128);
|
||||
m_dmrTXLevel = q15_t(dmrTXLevel * 128);
|
||||
m_ysfTXLevel = q15_t(ysfTXLevel * 128);
|
||||
|
|
3
IO.h
3
IO.h
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
void interrupt();
|
||||
|
||||
void setParameters(bool rxInvert, bool txInvert, bool pttInvert, uint8_t rxLevel, uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel);
|
||||
void setParameters(bool rxInvert, bool txInvert, bool pttInvert, uint8_t rxLevel, uint8_t cwIdTXLevel, uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel);
|
||||
|
||||
void getOverflow(bool& adcOverflow, bool& dacOverflow);
|
||||
|
||||
|
@ -81,6 +81,7 @@ private:
|
|||
|
||||
bool m_pttInvert;
|
||||
q15_t m_rxLevel;
|
||||
q15_t m_cwIdTXLevel;
|
||||
q15_t m_dstarTXLevel;
|
||||
q15_t m_dmrTXLevel;
|
||||
q15_t m_ysfTXLevel;
|
||||
|
|
|
@ -257,6 +257,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
m_sampleInsert = false;
|
||||
}
|
||||
|
||||
uint8_t cwIdTXLevel = data[5U];
|
||||
uint8_t dstarTXLevel = data[9U];
|
||||
uint8_t dmrTXLevel = data[10U];
|
||||
uint8_t ysfTXLevel = data[11U];
|
||||
|
@ -281,7 +282,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
dmrDMORX.setColorCode(colorCode);
|
||||
dmrIdleRX.setColorCode(colorCode);
|
||||
|
||||
io.setParameters(rxInvert, txInvert, pttInvert, rxLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel);
|
||||
io.setParameters(rxInvert, txInvert, pttInvert, rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel);
|
||||
|
||||
io.start();
|
||||
|
||||
|
|
Loading…
Reference in New Issue