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

Open both I and Q channels on plutosdr and change the inputthread accordingly

This commit is contained in:
Felix Schneider
2020-08-19 09:05:09 +02:00
parent afd76e274e
commit 7848b01987
3 changed files with 12 additions and 7 deletions
@@ -94,7 +94,7 @@ void PlutoSDRInputThread::run()
// Refill RX buffer
nbytes_rx = m_plutoBox->rxBufferRefill();
if (nbytes_rx != m_blockSizeSamples*2)
if (nbytes_rx != m_blockSizeSamples*4)
{
qWarning("PlutoSDRInputThread::run: error refilling buf (1) %d / %d",(int) nbytes_rx, (int) m_blockSizeSamples*2);
usleep(200000);
@@ -111,13 +111,14 @@ void PlutoSDRInputThread::run()
for (p_dat = m_plutoBox->rxBufferFirst(); p_dat < p_end; p_dat += p_inc)
{
m_buf[ihs] = *((int16_t *) p_dat);
m_buf[ihs++] = *((int16_t *) p_dat);
m_buf[ihs++] = *(((int16_t*)p_dat)+1);
// iio_channel_convert(m_plutoBox->getRxChannel0(), (void *) &m_bufConv[ihs], (const void *) &m_buf[ihs]);
ihs++;
//ihs++;
}
// Refill RX buffer again - we still need twice more samples to complete since they come as I followed by Q
nbytes_rx = m_plutoBox->rxBufferRefill();
/*nbytes_rx = m_plutoBox->rxBufferRefill();
if (nbytes_rx != m_blockSizeSamples*2)
{
@@ -139,7 +140,7 @@ void PlutoSDRInputThread::run()
// iio_channel_convert(m_plutoBox->getRxChannel0(), (void *) &m_bufConv[ihs], (const void *) &m_buf[ihs]);
ihs++;
}
*/
if (m_iqOrder) {
convertIQ(m_buf, 2*m_blockSizeSamples); // size given in number of int16_t (I and Q interleaved)
} else {