mirror of https://github.com/g4klx/MMDVM.git
Stripping ut stuff, testing
This commit is contained in:
parent
7befef2f4a
commit
87c3b57ae4
48
FM.cpp
48
FM.cpp
|
@ -64,18 +64,18 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length)
|
||||||
{
|
{
|
||||||
bool validCTCSS = m_ctcssRX.process(samples, length);
|
bool validCTCSS = m_ctcssRX.process(samples, length);
|
||||||
|
|
||||||
stateMachine(validCTCSS && cos, length);
|
stateMachine(validCTCSS /*&& cos*/, length);
|
||||||
|
|
||||||
if (m_modemState != STATE_FM)
|
if (m_modemState != STATE_FM)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Only let audio through when relaying audio
|
// Only let audio through when relaying audio
|
||||||
if (m_state != FS_RELAYING && m_state != FS_KERCHUNK) {
|
// if (m_state != FS_RELAYING && m_state != FS_KERCHUNK) {
|
||||||
for (uint8_t i = 0U; i < length; i++)
|
// for (uint8_t i = 0U; i < length; i++)
|
||||||
samples[i] = 0;
|
// samples[i] = 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!m_callsign.isRunning())
|
/*if (!m_callsign.isRunning())
|
||||||
m_rfAck.getAudio(samples, length);
|
m_rfAck.getAudio(samples, length);
|
||||||
|
|
||||||
if (!m_rfAck.isRunning())
|
if (!m_rfAck.isRunning())
|
||||||
|
@ -87,30 +87,32 @@ void CFM::samples(bool cos, q15_t* samples, uint8_t length)
|
||||||
q15_t output[RX_BLOCK_SIZE];
|
q15_t output[RX_BLOCK_SIZE];
|
||||||
::arm_fir_fast_q15(&m_filter, samples, output, length);
|
::arm_fir_fast_q15(&m_filter, samples, output, length);
|
||||||
|
|
||||||
m_ctcssTX.getAudio(output, length);
|
m_ctcssTX.getAudio(output, length);*/
|
||||||
|
|
||||||
for (uint8_t i = 0U; i < length; i++) {
|
io.write(STATE_FM, samples, length);
|
||||||
bool ret = m_ringBuffer.put(output[i]);
|
|
||||||
if (!ret) {
|
// for (uint8_t i = 0U; i < length; i++) {
|
||||||
DEBUG1("Overflow in the FM ring buffer");
|
// bool ret = m_ringBuffer.put(output[i]);
|
||||||
break;
|
// if (!ret) {
|
||||||
}
|
// DEBUG1("Overflow in the FM ring buffer");
|
||||||
}
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFM::process()
|
void CFM::process()
|
||||||
{
|
{
|
||||||
uint16_t space = io.getSpace();
|
// uint16_t space = io.getSpace();
|
||||||
uint16_t data = m_ringBuffer.getData();
|
// uint16_t data = m_ringBuffer.getData();
|
||||||
if (data < space)
|
// if (data < space)
|
||||||
space = data;
|
// space = data;
|
||||||
|
|
||||||
for (uint16_t i = 0U; i < space; i++) {
|
// for (uint16_t i = 0U; i < space; i++) {
|
||||||
q15_t sample;
|
// q15_t sample;
|
||||||
m_ringBuffer.get(sample);
|
// m_ringBuffer.get(sample);
|
||||||
|
|
||||||
io.write(STATE_FM, &sample, 1U);
|
// io.write(STATE_FM, &sample, 1U);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFM::reset()
|
void CFM::reset()
|
||||||
|
|
Loading…
Reference in New Issue