mirror of https://github.com/g4klx/MMDVM.git
Re-enable write audio to serial
This commit is contained in:
parent
a671263398
commit
1b40044a23
34
FM.cpp
34
FM.cpp
|
@ -173,26 +173,24 @@ void CFM::process()
|
||||||
io.write(STATE_FM, samples, length);
|
io.write(STATE_FM, samples, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //Write audio to serial
|
if (m_extEnabled) {
|
||||||
// if (m_downsampler.getData() >= 127 || m_state != STATE_FM) {//if we just left FM mode, so write all what is left in buffer, regardless of the amoutn of data
|
length = m_downsampler.getData();
|
||||||
// uint16_t length = m_downsampler.getData();
|
//Write audio to serial
|
||||||
|
if (length >= FM_SERIAL_BLOCK_SIZE) {
|
||||||
|
|
||||||
|
if(length > FM_SERIAL_BLOCK_SIZE)
|
||||||
|
length = FM_SERIAL_BLOCK_SIZE;
|
||||||
|
|
||||||
// if(length > FM_SERIAL_BLOCK_SIZE)//max message size on serial is 127
|
uint8_t serialSamples[FM_SERIAL_BLOCK_SIZE];
|
||||||
// length = FM_SERIAL_BLOCK_SIZE;
|
for(uint16_t i = 0U; i < length; i++) {
|
||||||
|
uint8_t serialSample = 0U;
|
||||||
|
m_downsampler.getPackedData(serialSample);
|
||||||
|
serialSamples[i] = serialSample;
|
||||||
|
}
|
||||||
|
|
||||||
// if(length > FM_SERIAL_BLOCK_SIZE)
|
serial.writeFMData(serialSamples, length);
|
||||||
// length = FM_SERIAL_BLOCK_SIZE;
|
}
|
||||||
|
}
|
||||||
// uint8_t serialSamples[FM_SERIAL_BLOCK_SIZE];
|
|
||||||
|
|
||||||
// for(uint16_t i = 0U; i < length; i++) {
|
|
||||||
// uint8_t serialSample = 0U;
|
|
||||||
// m_downsampler.getPackedData(serialSample);
|
|
||||||
// serialSamples[i] = serialSample;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// serial.writeFMData(serialSamples, length);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFM::reset()
|
void CFM::reset()
|
||||||
|
|
Loading…
Reference in New Issue