1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05: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)
{
qDebug("AirspyPlugin::enumSampleSources: failed to read serial no: %s", airspy_error_name(rc));
continue; // next
}
@ -88,6 +89,7 @@ PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
}
else
{
qDebug("AirspyPlugin::enumSampleSources: enumerated %d Airspy devices %s", i, airspy_error_name(rc));
break; // finished
}
}

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);
}

View File

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