1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

do not write the signal source gain if the AGC is enabled when using the AD9361.

This commit is contained in:
Marc Majoral 2021-09-14 17:46:52 +02:00
parent c3fe1bcc79
commit 80ccad790d

View File

@ -393,16 +393,22 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
{ {
std::cout << "Failed to set in_voltage1_gain_control_mode: " << ret << '\n'; std::cout << "Failed to set in_voltage1_gain_control_mode: " << ret << '\n';
} }
if (gain_mode_rx1_ == "manual")
{
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage0_hardwaregain", rf_gain_rx1_); ret = iio_device_attr_write_double(ad9361_phy, "in_voltage0_hardwaregain", rf_gain_rx1_);
if (ret < 0) if (ret < 0)
{ {
std::cout << "Failed to set in_voltage0_hardwaregain: " << ret << '\n'; std::cout << "Failed to set in_voltage0_hardwaregain: " << ret << '\n';
} }
}
if (gain_mode_rx2_ == "manual")
{
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage1_hardwaregain", rf_gain_rx2_); ret = iio_device_attr_write_double(ad9361_phy, "in_voltage1_hardwaregain", rf_gain_rx2_);
if (ret < 0) if (ret < 0)
{ {
std::cout << "Failed to set in_voltage1_hardwaregain: " << ret << '\n'; std::cout << "Failed to set in_voltage1_hardwaregain: " << ret << '\n';
} }
}
std::cout << "End of AD9361 RX configuration.\n"; std::cout << "End of AD9361 RX configuration.\n";
iio_context_destroy(ctx); iio_context_destroy(ctx);