kopia lustrzana https://github.com/f4exb/sdrangel
LimeSDR input: start and stop stream before and after the read loop. Use actual number of samples for callback
rodzic
65cccbdd75
commit
d3312c90d4
|
@ -70,6 +70,12 @@ void LimeSDRInputThread::run()
|
|||
m_running = true;
|
||||
m_startWaiter.wakeAll();
|
||||
|
||||
if (LMS_StartStream(m_stream) < 0) {
|
||||
qCritical("LimeSDRInputThread::run: could not start stream");
|
||||
} else {
|
||||
qDebug("LimeSDRInputThread::run: stream started");
|
||||
}
|
||||
|
||||
while (m_running)
|
||||
{
|
||||
if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0)
|
||||
|
@ -78,7 +84,14 @@ void LimeSDRInputThread::run()
|
|||
break;
|
||||
}
|
||||
|
||||
callback(m_buf, 2 * LIMESDR_BLOCKSIZE);
|
||||
callback(m_buf, 2 * res);
|
||||
}
|
||||
|
||||
|
||||
if (LMS_StopStream(m_stream) < 0) {
|
||||
qCritical("LimeSDRInputThread::run: could not stop stream");
|
||||
} else {
|
||||
qDebug("LimeSDRInputThread::run: stream stopped");
|
||||
}
|
||||
|
||||
m_running = false;
|
||||
|
|
Ładowanie…
Reference in New Issue