diff --git a/devices/plutosdr/deviceplutosdrbox.cpp b/devices/plutosdr/deviceplutosdrbox.cpp index 085924ee2..9df8c4964 100644 --- a/devices/plutosdr/deviceplutosdrbox.cpp +++ b/devices/plutosdr/deviceplutosdrbox.cpp @@ -41,14 +41,14 @@ DevicePlutoSDRBox::DevicePlutoSDRBox(const std::string& uri) : if (m_valid) { getXO(); setTracking(); -// int nb_channels = iio_device_get_channels_count(m_devRx); -// for (int i = 0; i < nb_channels; i++) { -// iio_channel_disable(iio_device_get_channel(m_devRx, i)); -// } -// nb_channels = iio_device_get_channels_count(m_devTx); -// for (int i = 0; i < nb_channels; i++) { -// iio_channel_disable(iio_device_get_channel(m_devTx, i)); -// } + int nb_channels = iio_device_get_channels_count(m_devRx); + for (int i = 0; i < nb_channels; i++) { + iio_channel_disable(iio_device_get_channel(m_devRx, i)); + } + nb_channels = iio_device_get_channels_count(m_devTx); + for (int i = 0; i < nb_channels; i++) { + iio_channel_disable(iio_device_get_channel(m_devTx, i)); + } } } diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputthread.cpp b/plugins/samplesource/plutosdrinput/plutosdrinputthread.cpp index 629faba3e..12ac6fc53 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputthread.cpp +++ b/plugins/samplesource/plutosdrinput/plutosdrinputthread.cpp @@ -92,24 +92,19 @@ void PlutoSDRInputThread::run() p_end = m_plutoBox->rxBufferEnd(); ihs = 0; -// qDebug("PlutoSDRInputThread::run: %ld samples read step: %ld", nbytes_rx / p_inc, p_inc); // p_inc is 2 on a char* buffer therefore each iteration processes only the I or Q sample - // I and Q samples are processed one at a time + // I and Q samples are processed one after the other // conversion is not needed as samples are little endian for (p_dat = m_plutoBox->rxBufferFirst(); p_dat < p_end; p_dat += p_inc) { -// m_buf[2*is] = ((int16_t *) p_dat)[0]; -// m_buf[2*is+1] = ((int16_t *) p_dat)[1]; -// memcpy(&m_buf[2*ihs], p_dat, 2*sizeof(int16_t)); m_buf[ihs] = *((int16_t *) p_dat); -// iio_channel_convert(m_plutoBox->getRxChannel0(), (void *) &m_bufConv[2*ihs], (const void *) &m_buf[2*ihs]); // iio_channel_convert(m_plutoBox->getRxChannel0(), (void *) &m_bufConv[ihs], (const void *) &m_buf[ihs]); ihs++; } - m_sampleFifo->write((unsigned char *) m_buf, ihs*sizeof(int16_t)); - //convert(m_bufConv, 2 * m_blockSize); + //m_sampleFifo->write((unsigned char *) m_buf, ihs*sizeof(int16_t)); + convert(m_buf, 2*m_blockSizeSamples); // size given in number of int16_t (I and Q interleaved) } m_running = false;