mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-04-05 06:26:42 +00:00
Implement Kerchunk TX option.
This commit is contained in:
parent
1309ad9326
commit
0ea732780d
3 changed files with 52 additions and 19 deletions
63
FM.cpp
63
FM.cpp
|
|
@ -41,6 +41,7 @@ m_callsignTimer(),
|
|||
m_timeoutTimer(),
|
||||
m_holdoffTimer(),
|
||||
m_kerchunkTimer(),
|
||||
m_kerchunkTX(true),
|
||||
m_ackMinTimer(),
|
||||
m_ackDelayTimer(),
|
||||
m_hangTimer(),
|
||||
|
|
@ -109,10 +110,10 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length)
|
|||
}
|
||||
|
||||
q15_t currentSample = currentRFSample;
|
||||
q15_t currentBoost = m_rfAudioBoost;
|
||||
if(m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT){
|
||||
q15_t currentBoost = m_rfAudioBoost;
|
||||
if (m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT) {
|
||||
currentSample = currentExtSample;
|
||||
currentBoost = m_extAudioBoost;
|
||||
currentBoost = m_extAudioBoost;
|
||||
}
|
||||
|
||||
// Only let RF audio through when relaying RF audio
|
||||
|
|
@ -244,7 +245,7 @@ uint8_t CFM::setAck(const char* rfAck, uint8_t speed, uint16_t frequency, uint8_
|
|||
return m_rfAck.setParams(rfAck, speed, frequency, level, level);
|
||||
}
|
||||
|
||||
uint8_t CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssHighThreshold, uint8_t ctcssLowThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, uint8_t hangTime, bool useCOS, bool cosInvert, uint8_t rfAudioBoost, uint8_t maxDev, uint8_t rxLevel)
|
||||
uint8_t CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFrequency, uint8_t ctcssHighThreshold, uint8_t ctcssLowThreshold, uint8_t ctcssLevel, uint8_t kerchunkTime, bool kerchunkTX, uint8_t hangTime, bool useCOS, bool cosInvert, uint8_t rfAudioBoost, uint8_t maxDev, uint8_t rxLevel)
|
||||
{
|
||||
m_useCOS = useCOS;
|
||||
m_cosInvert = cosInvert;
|
||||
|
|
@ -252,7 +253,10 @@ uint8_t CFM::setMisc(uint16_t timeout, uint8_t timeoutLevel, uint8_t ctcssFreque
|
|||
m_rfAudioBoost = q15_t(rfAudioBoost);
|
||||
|
||||
m_timeoutTimer.setTimeout(timeout, 0U);
|
||||
|
||||
m_kerchunkTimer.setTimeout(kerchunkTime, 0U);
|
||||
m_kerchunkTX = kerchunkTX;
|
||||
|
||||
m_hangTimer.setTimeout(hangTime, 0U);
|
||||
|
||||
m_timeoutTone.setParams(timeoutLevel);
|
||||
|
|
@ -358,17 +362,19 @@ void CFM::listeningState(bool validRFSignal, bool validExtSignal)
|
|||
sendCallsign();
|
||||
}
|
||||
|
||||
insertSilence(50U);
|
||||
if (m_state == FS_RELAYING_RF || (m_state == FS_KERCHUNK_RF && m_kerchunkTX)) {
|
||||
insertSilence(50U);
|
||||
|
||||
beginRelaying();
|
||||
beginRelaying();
|
||||
|
||||
m_callsignTimer.start();
|
||||
m_callsignTimer.start();
|
||||
|
||||
io.setDecode(true);
|
||||
io.setADCDetection(true);
|
||||
io.setDecode(true);
|
||||
io.setADCDetection(true);
|
||||
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
}
|
||||
} else if (validExtSignal) {
|
||||
if (m_kerchunkTimer.getTimeout() > 0U) {
|
||||
DEBUG1("State to KERCHUNK_EXT");
|
||||
|
|
@ -383,14 +389,16 @@ void CFM::listeningState(bool validRFSignal, bool validExtSignal)
|
|||
sendCallsign();
|
||||
}
|
||||
|
||||
insertSilence(50U);
|
||||
if (m_state == FS_RELAYING_EXT || (m_state == FS_KERCHUNK_EXT && m_kerchunkTX)) {
|
||||
insertSilence(50U);
|
||||
|
||||
beginRelaying();
|
||||
beginRelaying();
|
||||
|
||||
m_callsignTimer.start();
|
||||
m_callsignTimer.start();
|
||||
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -401,6 +409,19 @@ void CFM::kerchunkRFState(bool validSignal)
|
|||
DEBUG1("State to RELAYING_RF");
|
||||
m_state = FS_RELAYING_RF;
|
||||
m_kerchunkTimer.stop();
|
||||
if (!m_kerchunkTX) {
|
||||
insertSilence(50U);
|
||||
|
||||
beginRelaying();
|
||||
|
||||
m_callsignTimer.start();
|
||||
|
||||
io.setDecode(true);
|
||||
io.setADCDetection(true);
|
||||
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
}
|
||||
if (m_callsignAtStart && m_callsignAtLatch) {
|
||||
sendCallsign();
|
||||
m_callsignTimer.start();
|
||||
|
|
@ -499,6 +520,16 @@ void CFM::kerchunkExtState(bool validSignal)
|
|||
DEBUG1("State to RELAYING_EXT");
|
||||
m_state = FS_RELAYING_EXT;
|
||||
m_kerchunkTimer.stop();
|
||||
if (!m_kerchunkTX) {
|
||||
insertSilence(50U);
|
||||
|
||||
beginRelaying();
|
||||
|
||||
m_callsignTimer.start();
|
||||
|
||||
m_statusTimer.start();
|
||||
serial.writeFMStatus(m_state);
|
||||
}
|
||||
if (m_callsignAtStart && m_callsignAtLatch) {
|
||||
sendCallsign();
|
||||
m_callsignTimer.start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue