From 8f47d5b898d7b60f5139fed242309597834c0c52 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 14 Jul 2015 12:51:08 -0700 Subject: x300: Added max hw rev checking --- host/lib/usrp/x300/x300_fw_common.h | 1 + host/lib/usrp/x300/x300_impl.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/host/lib/usrp/x300/x300_fw_common.h b/host/lib/usrp/x300/x300_fw_common.h index 42583f7f0..76531f921 100644 --- a/host/lib/usrp/x300/x300_fw_common.h +++ b/host/lib/usrp/x300/x300_fw_common.h @@ -29,6 +29,7 @@ extern "C" { #endif +#define X300_MAX_HW_REV 6 #define X300_FW_COMPAT_MAJOR 3 #define X300_FW_COMPAT_MINOR 0 #define X300_FPGA_COMPAT_MAJOR 9 diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 809a56765..58914c02b 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -622,6 +622,16 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) mb.hw_rev = X300_REV("D"); } + UHD_VAR(mb.hw_rev) + if (mb.hw_rev > X300_MAX_HW_REV) { + throw uhd::runtime_error(str( + boost::format("Unsupported board revision number: %d.\n" + "The maximum board revision number supported in this version is %d.\n" + "Please update your UHD version.") + % mb.hw_rev % X300_MAX_HW_REV + )); + } + //Create clock control. NOTE: This does not configure the LMK yet. initialize_clock_control(mb); mb.clock = x300_clock_ctrl::make(mb.zpu_spi, -- cgit v1.2.3