From b53b3669216d34cb3940f5a6cf7cd79d71b837bb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 13 Aug 2013 11:04:43 -0700 Subject: b200: string names decided in one place --- host/lib/usrp/b200/b200_impl.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'host/lib/usrp/b200') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 8bacaf764..700a024de 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -190,12 +190,19 @@ b200_impl::b200_impl(const device_addr_t &device_addr) // Load the FPGA image, then reset GPIF //////////////////////////////////////////////////////////////////// std::string default_file_name; + std::string product_name = "B200?"; if (not mb_eeprom["product"].empty()) { switch (boost::lexical_cast(mb_eeprom["product"])) { - case 0x0001: default_file_name = B200_FPGA_FILE_NAME; break; - case 0x0002: default_file_name = B210_FPGA_FILE_NAME; break; + case 0x0001: + product_name = "B200"; + default_file_name = B200_FPGA_FILE_NAME; + break; + case 0x0002: + product_name = "B210"; + default_file_name = B210_FPGA_FILE_NAME; + break; default: throw uhd::runtime_error("b200 unknown product code: " + mb_eeprom["product"]); } } @@ -293,7 +300,7 @@ b200_impl::b200_impl(const device_addr_t &device_addr) // Initialize the properties tree //////////////////////////////////////////////////////////////////// _tree->create("/name").set("B-Series Device"); - _tree->create(mb_path / "name").set("B200"); + _tree->create(mb_path / "name").set(product_name); _tree->create(mb_path / "codename").set("Sasquatch"); //////////////////////////////////////////////////////////////////// @@ -329,12 +336,12 @@ b200_impl::b200_impl(const device_addr_t &device_addr) //////////////////////////////////////////////////////////////////// { const fs_path codec_path = mb_path / ("rx_codecs") / "A"; - _tree->create(codec_path / "name").set("B200 RX dual ADC"); + _tree->create(codec_path / "name").set(product_name+" RX dual ADC"); _tree->create(codec_path / "gains"); //empty cuz gains are in frontend } { const fs_path codec_path = mb_path / ("tx_codecs") / "A"; - _tree->create(codec_path / "name").set("B200 TX dual DAC"); + _tree->create(codec_path / "name").set(product_name+" TX dual DAC"); _tree->create(codec_path / "gains"); //empty cuz gains are in frontend } -- cgit v1.2.3