mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-14 07:44:11 +02:00
Add getData
This commit is contained in:
+7
-2
@@ -28,7 +28,7 @@ m_samplePackPointer(NULL),
|
|||||||
m_packIndex(0U),
|
m_packIndex(0U),
|
||||||
m_downSampleIndex(0U)
|
m_downSampleIndex(0U)
|
||||||
{
|
{
|
||||||
m_samplePackPointer = &m_samplePack;
|
m_samplePackPointer = &m_samplePack;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFMDownsampler::addSample(q15_t sample)
|
void CFMDownsampler::addSample(q15_t sample)
|
||||||
@@ -55,7 +55,7 @@ void CFMDownsampler::addSample(q15_t sample)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_packIndex++;
|
m_packIndex++;
|
||||||
if(m_packIndex >= 2U)//did we pack to samples ?
|
if(m_packIndex >= 2U)//did we pack two samples ?
|
||||||
m_packIndex = 0U;
|
m_packIndex = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +69,11 @@ bool CFMDownsampler::getPackedData(uint8_t& data)
|
|||||||
return m_ringBuffer.get(data);
|
return m_ringBuffer.get(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t CFMDownsampler::getData()
|
||||||
|
{
|
||||||
|
return m_ringBuffer.getData();
|
||||||
|
}
|
||||||
|
|
||||||
void CFMDownsampler::reset()
|
void CFMDownsampler::reset()
|
||||||
{
|
{
|
||||||
m_downSampleIndex = 0;
|
m_downSampleIndex = 0;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
CFMDownsampler(uint16_t length);
|
CFMDownsampler(uint16_t length);
|
||||||
void addSample(q15_t sample);
|
void addSample(q15_t sample);
|
||||||
bool getPackedData(uint8_t& data);
|
bool getPackedData(uint8_t& data);
|
||||||
|
uint16_t getData();
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user