From c8f72ab5f28c98868e083ee0f6526604ea4c4186 Mon Sep 17 00:00:00 2001 From: ratzrattillo <11601995+ratzrattillo@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:33:39 +0200 Subject: [PATCH 1/3] Update bladerf1.c Use quicktune parameters when calling schedule_retune with attached XB-200 --- .../libbladeRF/src/board/bladerf1/bladerf1.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c index 2d9364a71..03ba7f3b0 100644 --- a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c +++ b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c @@ -2066,8 +2066,19 @@ static int bladerf1_set_frequency(struct bladerf *dev, break; case BLADERF_TUNING_MODE_FPGA: { - status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, - frequency, NULL); + if (attached == BLADERF_XB_200) { + bladerf_quick_tune qt; + status = bladerf_get_quick_tune(dev, ch, &qt); + if (status != 0) { + return status; + } + + status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, 0, &qt); + } + else { + status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, frequency, NULL); + } + break; } From 6a9e4a9107974db1dcb0664e5f3ceb0388ae60eb Mon Sep 17 00:00:00 2001 From: ratzrattillo <11601995+ratzrattillo@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:37:50 +0200 Subject: [PATCH 2/3] Change log-level in bladerf1_schedule_retune --- host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c index 03ba7f3b0..bac635920 100644 --- a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c +++ b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c @@ -2405,7 +2405,7 @@ static int bladerf1_schedule_retune(struct bladerf *dev, if (quick_tune == NULL) { if (dev->xb == BLADERF_XB_200) { - log_error("Consider supplying the quick_tune parameter to" + log_info("Consider supplying the quick_tune parameter to" " bladerf_schedule_retune() when the XB-200 is enabled.\n"); } status = lms_calculate_tuning_params((uint32_t)frequency, &f); From e5521e1660aeffc9857d0120f8c2cb7a7bdcfe5a Mon Sep 17 00:00:00 2001 From: ratzrattillo <11601995+ratzrattillo@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:16:33 +0100 Subject: [PATCH 3/3] Update bladerf1.c Style fix --- host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c index bac635920..438786206 100644 --- a/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c +++ b/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c @@ -2074,8 +2074,7 @@ static int bladerf1_set_frequency(struct bladerf *dev, } status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, 0, &qt); - } - else { + } else { status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, frequency, NULL); }