From 6a3540ed463b7a42794d99d3f6417eba57f4f211 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Mon, 6 Jun 2022 15:53:57 -0500 Subject: x300: Fix invalid GPIO source bank error message When calling `get_gpio_srcs()` or `get_gpio_src()` with an invalid bank parameter, the error text associated with the `uhd::runtime_error` that is thrown prints the expected bank, not the erroneous bank, e.g.: >>> my_x310.get_gpio_srcs('BAD_BANK', 0) [ERROR] [X300::MB_CTRL] Invalid GPIO source bank: BAD_BANK. Only supported bank is FP0 Traceback (most recent call last): File "", line 2, in RuntimeError: RuntimeError: Invalid GPIO source bank: FP0 The invalid source bank on the last line should read BAD_BANK, not FP0. --- host/lib/usrp/x300/x300_mb_controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/x300/x300_mb_controller.cpp b/host/lib/usrp/x300/x300_mb_controller.cpp index ccbd7c20e..9ef20878e 100644 --- a/host/lib/usrp/x300/x300_mb_controller.cpp +++ b/host/lib/usrp/x300/x300_mb_controller.cpp @@ -503,7 +503,7 @@ std::vector x300_mb_controller::get_gpio_srcs(const std::string& ba "Invalid GPIO source bank: " << bank << ". Only supported bank is " << GPIO_SRC_BANK); throw uhd::runtime_error( - std::string("Invalid GPIO source bank: ") + GPIO_SRC_BANK); + std::string("Invalid GPIO source bank: ") + bank); } return {GPIO_SRC_RFA, GPIO_SRC_RFB}; } @@ -515,7 +515,7 @@ std::vector x300_mb_controller::get_gpio_src(const std::string& ban "Invalid GPIO source bank: " << bank << ". Only supported bank is " << GPIO_SRC_BANK); throw uhd::runtime_error( - std::string("Invalid GPIO source bank: ") + GPIO_SRC_BANK); + std::string("Invalid GPIO source bank: ") + bank); } uint32_t fp_gpio_src = _zpu_ctrl->peek32(SR_ADDR(SET0_BASE, ZPU_RB_FP_GPIO_SRC)); const auto gpio_srcs = get_gpio_srcs(bank); -- cgit v1.2.3