mirror of https://github.com/g4klx/MMDVM.git
Write larger chunks of FM audio to the serial port
This commit is contained in:
parent
8cbd52aa72
commit
eac2aa4ac1
18
FM.cpp
18
FM.cpp
|
@ -158,10 +158,20 @@ void CFM::process()
|
||||||
while (io.getSpace() >= 3U && m_outputRFRB.get(sample))
|
while (io.getSpace() >= 3U && m_outputRFRB.get(sample))
|
||||||
io.write(STATE_FM, &sample, 1U);
|
io.write(STATE_FM, &sample, 1U);
|
||||||
|
|
||||||
uint8_t serialSample;
|
if(m_downsampler.getData() >= 127) {
|
||||||
//write data to serial port
|
uint8_t length = uint8_t(m_downsampler.getData());
|
||||||
while (m_downsampler.getPackedData(serialSample))
|
|
||||||
serial.writeFMData(&serialSample, 1U);
|
if(length > 127U)//max message size on serial is 127
|
||||||
|
length = 127U;
|
||||||
|
|
||||||
|
uint8_t serialSamples[length];
|
||||||
|
|
||||||
|
for(uint8_t i = 0U; i < length; i++) {
|
||||||
|
uint8_t serialSample = 0U;
|
||||||
|
m_downsampler.getPackedData(serialSample);
|
||||||
|
}
|
||||||
|
serial.writeFMData(serialSamples, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFM::reset()
|
void CFM::reset()
|
||||||
|
|
Loading…
Reference in New Issue