diff --git a/FM.cpp b/FM.cpp index 3421d4d..ce40967 100644 --- a/FM.cpp +++ b/FM.cpp @@ -78,9 +78,11 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) q15_t currentRFSample = q15_t((q31_t(samples[i]) << 8) / m_rxLevel); uint8_t ctcssState = m_ctcssRX.process(currentRFSample); - // Delay the audio by 100ms to better match the CTCSS detector output - m_inputRFRB.put(currentRFSample); - m_inputRFRB.get(currentRFSample); + if (!m_useCOS) { + // Delay the audio by 100ms to better match the CTCSS detector output + m_inputRFRB.put(currentRFSample); + m_inputRFRB.get(currentRFSample); + } q15_t currentExtSample; bool inputExt = m_inputExtRB.get(currentExtSample);//always consume the external input data so it does not overflow @@ -153,9 +155,8 @@ void CFM::samples(bool cos, const q15_t* samples, uint8_t length) void CFM::process() { q15_t sample; - while(io.getSpace() >= 3U && m_outputRFRB.get(sample)) { + while(io.getSpace() >= 3U && m_outputRFRB.get(sample)) io.write(STATE_FM, &sample, 1U); - } } void CFM::reset() @@ -704,4 +705,3 @@ void CFM::insertSilence(uint16_t ms) for (uint32_t i = 0U; i < nSamples; i++) m_outputRFRB.put(0); } - diff --git a/NXDNTX.cpp b/NXDNTX.cpp index c4f5845..80ca120 100644 --- a/NXDNTX.cpp +++ b/NXDNTX.cpp @@ -82,7 +82,7 @@ void CNXDNTX::process() m_poBuffer[m_poLen++] = NXDN_PREAMBLE[2U]; } else { for (uint8_t i = 0U; i < NXDN_FRAME_LENGTH_BYTES; i++) { - uint8_t c; + uint8_t c = 0U; m_buffer.get(c); m_poBuffer[m_poLen++] = c; } @@ -168,4 +168,3 @@ uint8_t CNXDNTX::getSpace() const { return m_buffer.getSpace() / NXDN_FRAME_LENGTH_BYTES; } - diff --git a/P25TX.cpp b/P25TX.cpp index 6501f4e..fa2bfb6 100644 --- a/P25TX.cpp +++ b/P25TX.cpp @@ -79,7 +79,7 @@ void CP25TX::process() uint8_t length; m_buffer.get(length); for (uint8_t i = 0U; i < length; i++) { - uint8_t c; + uint8_t c = 0U; m_buffer.get(c); m_poBuffer[m_poLen++] = c; } diff --git a/POCSAGTX.cpp b/POCSAGTX.cpp index 0c252d8..335bd59 100644 --- a/POCSAGTX.cpp +++ b/POCSAGTX.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2018 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2018,2020 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,7 +61,7 @@ void CPOCSAGTX::process() m_poBuffer[m_poLen++] = POCSAG_SYNC; } else { for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) { - uint8_t c; + uint8_t c = 0U; m_buffer.get(c); m_poBuffer[m_poLen++] = c; } @@ -147,4 +147,3 @@ uint8_t CPOCSAGTX::getSpace() const { return m_buffer.getSpace() / POCSAG_FRAME_LENGTH_BYTES; } - diff --git a/YSFTX.cpp b/YSFTX.cpp index 5328418..15f3920 100644 --- a/YSFTX.cpp +++ b/YSFTX.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2018 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2018,2020 by Jonathan Naylor G4KLX * Copyright (C) 2017 by Andy Uribe CA6JAU * * This program is free software; you can redistribute it and/or modify @@ -76,7 +76,7 @@ void CYSFTX::process() m_poBuffer[m_poLen++] = YSF_START_SYNC; } else { for (uint8_t i = 0U; i < YSF_FRAME_LENGTH_BYTES; i++) { - uint8_t c; + uint8_t c = 0U; m_buffer.get(c); m_poBuffer[m_poLen++] = c; } @@ -192,4 +192,3 @@ void CYSFTX::setParams(bool on, uint8_t txHang) m_loDev = on; m_txHang = txHang * 1200U; } -