1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-31 19:29:17 +00:00

Update ad936x iio custom lib

This commit is contained in:
Javier Arribas 2022-09-22 15:15:07 +02:00
parent 8734a9f5c1
commit 205583bb27

View File

@ -512,9 +512,6 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
no_errors = false; no_errors = false;
} }
std::cout << "no_errors: " << no_errors << "\n";
if (enable_ch1 == true and enable_ch0 == true and freq_ != freq_2ch) if (enable_ch1 == true and enable_ch0 == true and freq_ != freq_2ch)
{ {
std::cout << "Two channels enabled with different frequencies, enabling the external RF transverter board:\n"; std::cout << "Two channels enabled with different frequencies, enabling the external RF transverter board:\n";
@ -583,10 +580,8 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
// { // {
// std::cout << "Warning: Unable to set AD936x RX filter parameters!\n"; // std::cout << "Warning: Unable to set AD936x RX filter parameters!\n";
// } // }
if (enable_ch0 == true) if (enable_ch0 == true)
{ {
n_channels++;
std::cerr << "* Get AD9361 Phy RX channel 0...\n"; std::cerr << "* Get AD9361 Phy RX channel 0...\n";
std::stringstream name; std::stringstream name;
name.str(""); name.str("");
@ -599,7 +594,8 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
std::cerr << "Could not find AD9361 phy channel: " << name.str() << "\n"; std::cerr << "Could not find AD9361 phy channel: " << name.str() << "\n";
no_errors = false; no_errors = false;
} }
else
{
ret = iio_channel_attr_write(phy_ch, "rf_port_select", rf_port_select_.c_str()); ret = iio_channel_attr_write(phy_ch, "rf_port_select", rf_port_select_.c_str());
if (ret < 0) if (ret < 0)
{ {
@ -633,10 +629,10 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
no_errors = false; no_errors = false;
} }
} }
}
if (enable_ch1 == true) if (enable_ch1 == true)
{ {
n_channels++;
std::cerr << "* Get AD9361 Phy RX channel 1...\n"; std::cerr << "* Get AD9361 Phy RX channel 1...\n";
std::stringstream name; std::stringstream name;
name.str(""); name.str("");
@ -649,7 +645,8 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
std::cerr << "Could not find AD9361 phy channel: " << name.str() << "\n"; std::cerr << "Could not find AD9361 phy channel: " << name.str() << "\n";
no_errors = false; no_errors = false;
} }
else
{
ret = iio_channel_attr_write(phy_ch, "rf_port_select", rf_port_select_.c_str()); ret = iio_channel_attr_write(phy_ch, "rf_port_select", rf_port_select_.c_str());
if (ret < 0) if (ret < 0)
{ {
@ -682,6 +679,7 @@ bool ad936x_iio_custom::init_config_ad9361_rx(long long bandwidth_,
no_errors = false; no_errors = false;
} }
} }
}
std::cout << "AD936x Front-end configuration summary: \n"; std::cout << "AD936x Front-end configuration summary: \n";
std::cout << "RF frequency tunned in AD936x: " << freq_ << " [Hz]\n"; std::cout << "RF frequency tunned in AD936x: " << freq_ << " [Hz]\n";