Add getData

This commit is contained in:
Geoffrey Merck 2020-05-11 19:01:05 +02:00
parent 5d4df6ffd9
commit 86ffc69b30
2 changed files with 8 additions and 2 deletions

View File

@ -55,7 +55,7 @@ void CFMDownsampler::addSample(q15_t sample)
break;
}
m_packIndex++;
if(m_packIndex >= 2U)//did we pack to samples ?
if(m_packIndex >= 2U)//did we pack two samples ?
m_packIndex = 0U;
}
@ -69,6 +69,11 @@ bool CFMDownsampler::getPackedData(uint8_t& data)
return m_ringBuffer.get(data);
}
uint16_t CFMDownsampler::getData()
{
return m_ringBuffer.getData();
}
void CFMDownsampler::reset()
{
m_downSampleIndex = 0;

View File

@ -28,6 +28,7 @@ public:
CFMDownsampler(uint16_t length);
void addSample(q15_t sample);
bool getPackedData(uint8_t& data);
uint16_t getData();
void reset();
private: