1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-09-21 03:39:48 +00:00

Fix building for -DENABLE_PLUTOSDR=ON

This commit is contained in:
Carles Fernandez 2024-08-19 14:21:59 +02:00
parent 126421f847
commit 6836ac44fb
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 30 additions and 23 deletions

View File

@ -3338,7 +3338,7 @@ set_package_properties(LIBIIO PROPERTIES
PURPOSE "Used for communication with the AD9361 chipset." PURPOSE "Used for communication with the AD9361 chipset."
TYPE OPTIONAL TYPE OPTIONAL
) )
if(ENABLE_AD9361 OR ENABLE_FMCOMMS2) if(ENABLE_AD9361 OR ENABLE_FMCOMMS2 OR ENABLE_PLUTOSDR)
if(NOT LIBIIO_FOUND) if(NOT LIBIIO_FOUND)
message(STATUS "libiio not found, its installation is required.") message(STATUS "libiio not found, its installation is required.")
message(STATUS "Please build and install the following projects:") message(STATUS "Please build and install the following projects:")

View File

@ -239,7 +239,7 @@ if(ENABLE_LIMESDR AND GRLIMESDR_FOUND)
) )
endif() endif()
if(ENABLE_AD9361 AND LIBIIO_FOUND) if(LIBIIO_FOUND)
target_link_libraries(signal_source_adapters target_link_libraries(signal_source_adapters
PRIVATE PRIVATE
Iio::iio Iio::iio

View File

@ -87,7 +87,7 @@ ad936x_iio_source_sptr ad936x_iio_make_source_sptr(
void ad936x_iio_source::ad9361_channel_demux_and_record(ad936x_iio_samples *samples_in, int nchannels, std::vector<std::fstream> *files_out) void ad936x_iio_source::ad9361_channel_demux_and_record(ad936x_iio_samples *samples_in, int nchannels, std::vector<std::fstream> *files_out)
{ {
int32_t current_byte = 0; uint32_t current_byte = 0;
int16_t ch = 0; int16_t ch = 0;
// std::cout << "nbytes: " << samples_in->n_bytes << " nsamples: " << samples_in->n_samples << " nch: " << nchannels << "\n"; // std::cout << "nbytes: " << samples_in->n_bytes << " nsamples: " << samples_in->n_samples << " nch: " << nchannels << "\n";
while (current_byte < samples_in->n_bytes) while (current_byte < samples_in->n_bytes)

View File

@ -1,6 +1,7 @@
/*! /*!
* \file ad936x_iio_custom.cc * \file ad936x_iio_custom.cc
* \brief A direct IIO custom front-end driver for the AD936x AD front-end family with special FPGA custom functionalities. * \brief A direct IIO custom front-end driver for the AD936x AD front-end
* family with special FPGA custom functionalities.
* \author Javier Arribas, jarribas(at)cttc.es * \author Javier Arribas, jarribas(at)cttc.es
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
* *

View File

@ -1,6 +1,7 @@
/*! /*!
* \file ad936x_iio_custom.h * \file ad936x_iio_custom.h
* \brief A direct IIO custom front-end driver for the AD936x AD front-end family with special FPGA custom functionalities. * \brief A direct IIO custom front-end driver for the AD936x AD front-end
* family with special FPGA custom functionalities.
* \author Javier Arribas, jarribas(at)cttc.es * \author Javier Arribas, jarribas(at)cttc.es
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
* *
@ -14,27 +15,27 @@
*/ */
#ifndef SRC_LIBS_ad936x_iio_custom_H_ #ifndef GNSS_SDR_AD936X_IIO_CUSTOM_H
#define SRC_LIBS_ad936x_iio_custom_H_ #define GNSS_SDR_AD936X_IIO_CUSTOM_H
#include "ad936x_iio_samples.h"
#include "concurrent_queue.h" #include "concurrent_queue.h"
#include "gnss_time.h" #include "gnss_time.h"
#include "pps_samplestamp.h" #include "pps_samplestamp.h"
#include <boost/atomic.hpp> #include <boost/atomic.hpp>
#include <iio.h>
#include <ad9361.h> // multichip sync and high level functions
#include <memory> #include <memory>
#include <string> #include <string>
#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif
#include "ad936x_iio_samples.h"
#include <ad9361.h> // multichip sync and high level functions
#include <thread> #include <thread>
#include <vector> #include <vector>
/** \addtogroup Signal_Source
* \{ */
/** \addtogroup Signal_Source_libs
* \{ */
class ad936x_iio_custom class ad936x_iio_custom
{ {
public: public:
@ -121,10 +122,7 @@ private:
struct iio_device *dds_dev; struct iio_device *dds_dev;
// stream // stream
uint64_t sample_rate_sps; uint64_t sample_rate_sps;
int debug_level; int debug_level;
int log_level; int log_level;
bool PPS_mode; bool PPS_mode;
@ -144,4 +142,6 @@ private:
std::thread capture_time_thread; std::thread capture_time_thread;
}; };
#endif /* SRC_LIBS_ad936x_iio_custom_H_ */ /** \} */
/** \} */
#endif // GNSS_SDR_AD936X_IIO_CUSTOM_H

View File

@ -15,17 +15,21 @@
*/ */
#ifndef SRC_LIBS_ad936x_iio_samples_H_ #ifndef GNSS_SDR_AD936X_IIO_SAMPLES_H
#define SRC_LIBS_ad936x_iio_samples_H_ #define GNSS_SDR_AD936X_IIO_SAMPLES_H
#define IIO_DEFAULTAD936XAPIFIFOSIZE_SAMPLES 32768 * 4 #define IIO_DEFAULTAD936XAPIFIFOSIZE_SAMPLES 32768 * 4
#define IIO_INPUTRAMFIFOSIZE 256 #define IIO_INPUTRAMFIFOSIZE 256
#include <memory> #include <memory>
#include <stdint.h> #include <stdint.h>
#include <vector> #include <vector>
/** \addtogroup Signal_Source
* \{ */
/** \addtogroup Signal_Source_libs
* \{ */
class ad936x_iio_samples class ad936x_iio_samples
{ {
public: public:
@ -37,4 +41,6 @@ public:
char buffer[IIO_DEFAULTAD936XAPIFIFOSIZE_SAMPLES * 4 * 4]; // max 16 bits samples per buffer (4 channels, 2-bytes per I + 2-bytes per Q) char buffer[IIO_DEFAULTAD936XAPIFIFOSIZE_SAMPLES * 4 * 4]; // max 16 bits samples per buffer (4 channels, 2-bytes per I + 2-bytes per Q)
}; };
/** \} */
/** \} */
#endif #endif