aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2022-06-06 15:53:57 -0500
committerskooNI <60897865+skooNI@users.noreply.github.com>2022-07-20 15:57:20 -0500
commit6a3540ed463b7a42794d99d3f6417eba57f4f211 (patch)
treefe5b0ce7200af3978f8cfc43c5c6fa71b7bf7e31 /host/lib
parent44c50ff370c79eed7c6455c77e2b91b7488c554e (diff)
downloaduhd-6a3540ed463b7a42794d99d3f6417eba57f4f211.tar.gz
uhd-6a3540ed463b7a42794d99d3f6417eba57f4f211.tar.bz2
uhd-6a3540ed463b7a42794d99d3f6417eba57f4f211.zip
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 "<stdin>", line 2, in <module> RuntimeError: RuntimeError: Invalid GPIO source bank: FP0 The invalid source bank on the last line should read BAD_BANK, not FP0.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/x300/x300_mb_controller.cpp4
1 files changed, 2 insertions, 2 deletions
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<std::string> 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<std::string> 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);