diff options
author | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-06-06 15:53:57 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-06-09 05:38:27 -0700 |
commit | 56f3aab28e9037d63b1008f5622471aecdd0f6d0 (patch) | |
tree | 8d05bb93abdf236a132747530290bc757820276d | |
parent | mpm: udp: Fix Pylint warnings in UDP-related files (diff) | |
download | uhd-56f3aab28e9037d63b1008f5622471aecdd0f6d0.tar.xz uhd-56f3aab28e9037d63b1008f5622471aecdd0f6d0.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.
-rw-r--r-- | host/lib/usrp/x300/x300_mb_controller.cpp | 4 |
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); |