diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-19 09:36:53 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-19 09:36:53 -0700 |
commit | a28099fe4abe10b11c9234d67b243adbd20ce1a1 (patch) | |
tree | 38cad47d5d7544c7800a471beef5bba2d07b263f | |
parent | 668402f27e34422a9afdc4d12f0f5575228f815b (diff) | |
download | uhd-a28099fe4abe10b11c9234d67b243adbd20ce1a1.tar.gz uhd-a28099fe4abe10b11c9234d67b243adbd20ce1a1.tar.bz2 uhd-a28099fe4abe10b11c9234d67b243adbd20ce1a1.zip |
usrp2: improve the compatibility error messages
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_iface.cpp | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 7a6c596bc..29e0535f8 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -71,8 +71,10 @@ usrp2_mboard_impl::usrp2_mboard_impl( const boost::uint32_t fpga_compat_num = _iface->peek32(_iface->regs.compat_num_rb); if (fpga_compat_num != USRP2_FPGA_COMPAT_NUM){ throw uhd::runtime_error(str(boost::format( - "Expected fpga compatibility number %d, but got %d:\n" - "The fpga build is not compatible with the host code build." + "\nPlease update the firmware and FPGA images for your device.\n" + "See the application notes for USRP2/N-Series for instructions.\n" + "Expected FPGA compatibility number %d, but got %d:\n" + "The FPGA build is not compatible with the host code build." ) % int(USRP2_FPGA_COMPAT_NUM) % fpga_compat_num)); } diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index 6b3409ecc..d88d31765 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -242,11 +242,6 @@ public: ){ boost::mutex::scoped_lock lock(_ctrl_mutex); - std::string range = (lo == hi)? - str(boost::format("%d") % hi) : - str(boost::format("[%d to %d]") % lo % hi) - ; - //fill in the seq number and send usrp2_ctrl_data_t out_copy = out_data; out_copy.proto_ver = htonl(_protocol_compat); @@ -261,9 +256,11 @@ public: boost::uint32_t compat = ntohl(ctrl_data_in->proto_ver); if(len >= sizeof(boost::uint32_t) and (hi < compat or lo > compat)){ throw uhd::runtime_error(str(boost::format( + "\nPlease update the firmware and FPGA images for your device.\n" + "See the application notes for USRP2/N-Series for instructions.\n" "Expected protocol compatibility number %s, but got %d:\n" "The firmware build is not compatible with the host code build." - ) % range % compat)); + ) % ((lo == hi)? (boost::format("%d") % hi) : (boost::format("[%d to %d]") % lo % hi)) % compat)); } if (len >= sizeof(usrp2_ctrl_data_t) and ntohl(ctrl_data_in->seq) == _ctrl_seq_num){ return *ctrl_data_in; |