1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

BladeRF2 input: do not re-create the thread if there are no more channels active

This commit is contained in:
f4exb
2018-09-27 06:37:31 +02:00
parent d5a33b7448
commit 7078cd868e
2 changed files with 25 additions and 8 deletions
@@ -22,6 +22,7 @@ BladeRF2InputThread::BladeRF2InputThread(struct bladerf* dev, unsigned int nbRxC
m_dev(dev),
m_nbChannels(nbRxChannels)
{
qDebug("BladeRF2InputThread::BladeRF2InputThread");
m_channels = new Channel[nbRxChannels];
for (unsigned int i = 0; i < nbRxChannels; i++) {
@@ -86,6 +87,7 @@ void BladeRF2InputThread::run()
}
else
{
qDebug("BladeRF2InputThread::run: start running loop");
while (m_running)
{
res = bladerf_sync_rx(m_dev, m_buf, DeviceBladeRF2::blockSize, NULL, 10000);
@@ -102,6 +104,7 @@ void BladeRF2InputThread::run()
callbackSI(m_buf, 2*DeviceBladeRF2::blockSize);
}
}
qDebug("BladeRF2InputThread::run: stop running loop");
}
}
else