mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-21 21:40:18 +00:00
Fix for old versions of libad9361
This commit is contained in:
parent
54698bd211
commit
b0c00eb5b0
@ -2292,7 +2292,6 @@ set_package_properties(LIBAD9361 PROPERTIES
|
|||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
)
|
)
|
||||||
if(NOT LIBAD9361_FOUND)
|
if(NOT LIBAD9361_FOUND)
|
||||||
set(GRIIO_FOUND FALSE)
|
|
||||||
set(ENABLE_AD9361 OFF)
|
set(ENABLE_AD9361 OFF)
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||||
|
@ -70,6 +70,13 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
Iio::ad9361
|
Iio::ad9361
|
||||||
)
|
)
|
||||||
|
if(LIBAD9361_VERSION)
|
||||||
|
if(LIBAD9361_VERSION VERSION_GREATER 0.1)
|
||||||
|
target_compile_definitions(signal_source_libs
|
||||||
|
PUBLIC -DLIBAD9361_VERSION_GREATER_THAN_01=1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
|
@ -189,7 +189,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
bool quadrature_,
|
bool quadrature_,
|
||||||
bool rfdc_,
|
bool rfdc_,
|
||||||
bool bbdc_,
|
bool bbdc_,
|
||||||
const std::string &filter_source_,
|
std::string filter_source_,
|
||||||
std::string filter_filename_,
|
std::string filter_filename_,
|
||||||
float Fpass_,
|
float Fpass_,
|
||||||
float Fstop_)
|
float Fstop_)
|
||||||
@ -204,6 +204,19 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
struct iio_channel *rx_chan2;
|
struct iio_channel *rx_chan2;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifndef LIBAD9361_VERSION_GREATER_THAN_01
|
||||||
|
if (filter_source_ == "Design")
|
||||||
|
{
|
||||||
|
std::cout << "Option filter_source=Design is not available in this version. Set to filter_source=Off" << std::endl;
|
||||||
|
filter_source_ = std::string("Off");
|
||||||
|
}
|
||||||
|
if (Fpass_ != 0.0 or Fstop_ != 0.0)
|
||||||
|
{
|
||||||
|
Fpass_ = 0.0;
|
||||||
|
Fstop_ = 0.0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ctx = iio_create_default_context();
|
ctx = iio_create_default_context();
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
{
|
{
|
||||||
@ -301,6 +314,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
}
|
}
|
||||||
wr_ch_lli(rx_chan1, "frequency", freq_);
|
wr_ch_lli(rx_chan1, "frequency", freq_);
|
||||||
}
|
}
|
||||||
|
#if LIBAD9361_VERSION_GREATER_THAN_01
|
||||||
else if (filter_source_ == "Design")
|
else if (filter_source_ == "Design")
|
||||||
{
|
{
|
||||||
ret = ad9361_set_bb_rate_custom_filter_manual(
|
ret = ad9361_set_bb_rate_custom_filter_manual(
|
||||||
@ -321,6 +335,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
}
|
}
|
||||||
wr_ch_lli(rx_chan1, "frequency", freq_);
|
wr_ch_lli(rx_chan1, "frequency", freq_);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Unknown filter configuration");
|
throw std::runtime_error("Unknown filter configuration");
|
||||||
@ -409,7 +424,7 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
bool quadrature_,
|
bool quadrature_,
|
||||||
bool rfdc_,
|
bool rfdc_,
|
||||||
bool bbdc_,
|
bool bbdc_,
|
||||||
const std::string &filter_source_,
|
std::string filter_source_,
|
||||||
std::string filter_filename_,
|
std::string filter_filename_,
|
||||||
float Fpass_,
|
float Fpass_,
|
||||||
float Fstop_)
|
float Fstop_)
|
||||||
@ -422,6 +437,19 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
struct iio_channel *rx_chan1;
|
struct iio_channel *rx_chan1;
|
||||||
struct iio_channel *rx_chan2;
|
struct iio_channel *rx_chan2;
|
||||||
|
|
||||||
|
#ifndef LIBAD9361_VERSION_GREATER_THAN_01
|
||||||
|
if (filter_source_ == "Design")
|
||||||
|
{
|
||||||
|
std::cout << "Option filter_source=Design is not available in this version. Set to filter_source=Off" << std::endl;
|
||||||
|
filter_source_ = std::string("Off");
|
||||||
|
}
|
||||||
|
if (Fpass_ != 0.0 or Fstop_ != 0.0)
|
||||||
|
{
|
||||||
|
Fpass_ = 0.0;
|
||||||
|
Fstop_ = 0.0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ctx = iio_create_network_context(remote_host.c_str());
|
ctx = iio_create_network_context(remote_host.c_str());
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
{
|
{
|
||||||
@ -523,6 +551,7 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
}
|
}
|
||||||
wr_ch_lli(rx_chan1, "frequency", freq_);
|
wr_ch_lli(rx_chan1, "frequency", freq_);
|
||||||
}
|
}
|
||||||
|
#if LIBAD9361_VERSION_GREATER_THAN_01
|
||||||
else if (filter_source_ == "Design")
|
else if (filter_source_ == "Design")
|
||||||
{
|
{
|
||||||
ret = ad9361_set_bb_rate_custom_filter_manual(
|
ret = ad9361_set_bb_rate_custom_filter_manual(
|
||||||
@ -543,6 +572,7 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
}
|
}
|
||||||
wr_ch_lli(rx_chan1, "frequency", freq_);
|
wr_ch_lli(rx_chan1, "frequency", freq_);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Unknown filter configuration");
|
throw std::runtime_error("Unknown filter configuration");
|
||||||
|
@ -93,7 +93,7 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
bool quadrature_,
|
bool quadrature_,
|
||||||
bool rfdc_,
|
bool rfdc_,
|
||||||
bool bbdc_,
|
bool bbdc_,
|
||||||
const std::string &filter_source_,
|
std::string filter_source_,
|
||||||
std::string filter_filename_,
|
std::string filter_filename_,
|
||||||
float Fpass_,
|
float Fpass_,
|
||||||
float Fstop_);
|
float Fstop_);
|
||||||
@ -109,7 +109,11 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
double rf_gain_rx2_,
|
double rf_gain_rx2_,
|
||||||
bool quadrature_,
|
bool quadrature_,
|
||||||
bool rfdc_,
|
bool rfdc_,
|
||||||
bool bbdc_);
|
bool bbdc_,
|
||||||
|
std::string filter_source_,
|
||||||
|
std::string filter_filename_,
|
||||||
|
float Fpass_,
|
||||||
|
float Fstop_);
|
||||||
|
|
||||||
bool config_ad9361_lo_local(uint64_t bandwidth_,
|
bool config_ad9361_lo_local(uint64_t bandwidth_,
|
||||||
uint64_t sample_rate_,
|
uint64_t sample_rate_,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user