1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

LimeSDR: use constant instead of define for buffer size

This commit is contained in:
f4exb
2020-04-09 06:45:12 +02:00
parent 73af940e89
commit b7fc2f255c
5 changed files with 14 additions and 14 deletions
@@ -30,7 +30,7 @@ LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo*
m_sampleFifo(sampleFifo),
m_log2Interp(0)
{
std::fill(m_buf, m_buf + 2*LIMESDROUTPUT_BLOCKSIZE, 0);
std::fill(m_buf, m_buf + 2*DeviceLimeSDR::blockSize, 0);
}
LimeSDROutputThread::~LimeSDROutputThread()
@@ -89,18 +89,18 @@ void LimeSDROutputThread::run()
while (m_running)
{
callback(m_buf, LIMESDROUTPUT_BLOCKSIZE);
callback(m_buf, DeviceLimeSDR::blockSize);
res = LMS_SendStream(m_stream, (void *) m_buf, LIMESDROUTPUT_BLOCKSIZE, &metadata, 1000000);
res = LMS_SendStream(m_stream, (void *) m_buf, DeviceLimeSDR::blockSize, &metadata, 1000000);
if (res < 0)
{
qCritical("LimeSDROutputThread::run write error: %s", strerror(errno));
break;
}
else if (res != LIMESDROUTPUT_BLOCKSIZE)
else if (res != DeviceLimeSDR::blockSize)
{
qDebug("LimeSDROutputThread::run written %d/%d samples", res, LIMESDROUTPUT_BLOCKSIZE);
qDebug("LimeSDROutputThread::run written %d/%d samples", res, DeviceLimeSDR::blockSize);
}
}
@@ -26,8 +26,7 @@
#include "dsp/interpolators.h"
#include "limesdr/devicelimesdrshared.h"
#define LIMESDROUTPUT_BLOCKSIZE (1<<15) //complex samples per buffer ~10k (16k)
#include "limesdr/devicelimesdr.h"
class SampleSourceFifo;
@@ -51,7 +50,7 @@ private:
bool m_running;
lms_stream_t* m_stream;
qint16 m_buf[2*LIMESDROUTPUT_BLOCKSIZE]; //must hold I+Q values of each sample hence 2xcomplex size
qint16 m_buf[2*DeviceLimeSDR::blockSize]; //must hold I+Q values of each sample hence 2xcomplex size
SampleSourceFifo* m_sampleFifo;
unsigned int m_log2Interp; // soft decimation