ms: conditionally override the tuning mode

We want FPGA tuning because it is much faster, but unfortunately
throwing trash at it leads to the blade getting stuck until it is power
cycled or reinitialized using host tuning. Only set FPGA tuning if no
other mode like BLADERF_DEFAULT_TUNING_MODE=host is requested, which
allows easier recovery in those cases.

Change-Id: I11f2ecc50b480d71736a7f224295e5e37745385e
This commit is contained in:
Eric Wild 2024-01-31 19:30:47 +01:00
parent a2d76f1d2f
commit c8a4450641
1 changed files with 2 additions and 1 deletions

View File

@ -255,7 +255,8 @@ struct blade_hw {
bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_DEBUG);
bladerf_set_usb_reset_on_open(true);
setenv("BLADERF_DEFAULT_TUNING_MODE","fpga",1); // ensure blade 2 does not spend 10 seconds initializing host control
if (getenv("BLADERF_DEFAULT_TUNING_MODE") == NULL)
setenv("BLADERF_DEFAULT_TUNING_MODE","fpga",1); // ensure blade 2 does not spend 10 seconds initializing host control
blade_check(bladerf_open, &dev, "");
if (!dev) {
std::cerr << "open failed, device missing?" << std::endl;