Simplify code

This commit is contained in:
Geoffrey Merck 2020-05-09 08:29:31 +02:00
parent e91c4417cb
commit 5d45649096
1 changed files with 7 additions and 7 deletions

14
FM.cpp
View File

@ -102,19 +102,19 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length)
} }
q15_t currentSample = currentRFSample; q15_t currentSample = currentRFSample;
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; currentSample = currentExtSample;
currentBoost = m_extAudioBoost;
}
// Only let RF audio through when relaying RF audio // Only let RF audio through when relaying RF audio
if (m_state == FS_RELAYING_RF || m_state == FS_KERCHUNK_RF) { if (m_state == FS_RELAYING_RF || m_state == FS_KERCHUNK_RF || m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT) {
if (m_extEnabled) if (m_extEnabled && (m_state == FS_RELAYING_RF || m_state == FS_KERCHUNK_RF))
m_downsampler.addSample(currentSample); m_downsampler.addSample(currentSample);
currentSample = m_blanking.process(currentSample); currentSample = m_blanking.process(currentSample);
currentSample *= m_rfAudioBoost; currentSample *= currentBoost;
} else if (m_state == FS_RELAYING_EXT || m_state == FS_KERCHUNK_EXT) {
currentSample = m_blanking.process(currentSample);
currentSample *= m_extAudioBoost;
} else { } else {
currentSample = 0; currentSample = 0;
} }