1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-29 00:06:34 -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

View File

@ -73,6 +73,7 @@ PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
if (rc != AIRSPY_SUCCESS) if (rc != AIRSPY_SUCCESS)
{ {
qDebug("AirspyPlugin::enumSampleSources: failed to read serial no: %s", airspy_error_name(rc));
continue; // next continue; // next
} }
@ -88,6 +89,7 @@ PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
} }
else else
{ {
qDebug("AirspyPlugin::enumSampleSources: enumerated %d Airspy devices %s", i, airspy_error_name(rc));
break; // finished break; // finished
} }
} }

View File

@ -20,7 +20,7 @@
#include "airspythread.h" #include "airspythread.h"
#include "dsp/samplefifo.h" #include "dsp/samplefifo.h"
AirspyThread *airspyThread = 0; AirspyThread *AirspyThread::m_this = 0;
AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QObject* parent) : AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QObject* parent) :
QThread(parent), QThread(parent),
@ -32,13 +32,13 @@ AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QO
m_log2Decim(0), m_log2Decim(0),
m_fcPos(0) m_fcPos(0)
{ {
airspyThread = this; m_this = this;
} }
AirspyThread::~AirspyThread() AirspyThread::~AirspyThread()
{ {
stopWork(); stopWork();
airspyThread = 0; m_this = 0;
} }
void AirspyThread::startWork() void AirspyThread::startWork()
@ -185,5 +185,5 @@ void AirspyThread::callback(const qint16* buf, qint32 len)
int AirspyThread::rx_callback(airspy_transfer_t* transfer) int AirspyThread::rx_callback(airspy_transfer_t* transfer)
{ {
qint32 bytes_to_write = transfer->sample_count * sizeof(qint16) * 2; 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);
} }

View File

@ -52,6 +52,7 @@ private:
int m_samplerate; int m_samplerate;
unsigned int m_log2Decim; unsigned int m_log2Decim;
int m_fcPos; int m_fcPos;
static AirspyThread *m_this;
Decimators<qint16, SDR_SAMP_SZ, 12> m_decimators; Decimators<qint16, SDR_SAMP_SZ, 12> m_decimators;