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

Support for Airspy: make pointer to thread private. Debug messages on enumeration

This commit is contained in:
f4exb
2015-09-10 08:12:49 +02:00
parent 61e6e3e2cc
commit 7e88cfcd48
3 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -20,7 +20,7 @@
#include "airspythread.h"
#include "dsp/samplefifo.h"
AirspyThread *airspyThread = 0;
AirspyThread *AirspyThread::m_this = 0;
AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QObject* parent) :
QThread(parent),
@@ -32,13 +32,13 @@ AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QO
m_log2Decim(0),
m_fcPos(0)
{
airspyThread = this;
m_this = this;
}
AirspyThread::~AirspyThread()
{
stopWork();
airspyThread = 0;
m_this = 0;
}
void AirspyThread::startWork()
@@ -185,5 +185,5 @@ void AirspyThread::callback(const qint16* buf, qint32 len)
int AirspyThread::rx_callback(airspy_transfer_t* transfer)
{
qint32 bytes_to_write = transfer->sample_count * sizeof(qint16) * 2;
airspyThread->callback((qint16 *) transfer->samples, bytes_to_write);
m_this->callback((qint16 *) transfer->samples, bytes_to_write);
}