mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-23 02:55:01 +02:00
Make sure downsampler always buffers 22 samples at a time
This commit is contained in:
+8
-2
@@ -23,16 +23,22 @@
|
||||
#include "Config.h"
|
||||
#include "RingBuffer.h"
|
||||
|
||||
struct TSamplePairPack {
|
||||
uint8_t byte0;
|
||||
uint8_t byte1;
|
||||
uint8_t byte2;
|
||||
};
|
||||
|
||||
class CFMDownsampler {
|
||||
public:
|
||||
CFMDownsampler(uint16_t length);
|
||||
void addSample(q15_t sample);
|
||||
bool getPackedData(uint8_t& data);
|
||||
bool getPackedData(TSamplePairPack& data);
|
||||
uint16_t getData();
|
||||
void reset();
|
||||
|
||||
private:
|
||||
CRingBuffer<uint8_t> m_ringBuffer;
|
||||
CRingBuffer<TSamplePairPack> m_ringBuffer;
|
||||
|
||||
uint32_t m_samplePack;
|
||||
uint32_t *m_samplePackPointer;
|
||||
|
||||
Reference in New Issue
Block a user