diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-09-01 15:20:42 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-09-01 15:20:42 -0700 |
commit | 6464a000150858b5d65a53490f0593d5ba1e4ca6 (patch) | |
tree | a199c3773d683d9e37fa300900291c3628cff6e4 /host | |
parent | d697bff4547b6a7fb95e127ec12e2989fc6fc2e5 (diff) | |
parent | 8adefb1d80f08a53856fef45b80ed5a07f0a9a26 (diff) | |
download | uhd-6464a000150858b5d65a53490f0593d5ba1e4ca6.tar.gz uhd-6464a000150858b5d65a53490f0593d5ba1e4ca6.tar.bz2 uhd-6464a000150858b5d65a53490f0593d5ba1e4ca6.zip |
Merge branch 'maint'
Diffstat (limited to 'host')
-rw-r--r-- | host/docs/usrp_e3x0.dox | 2 | ||||
-rw-r--r-- | host/examples/tx_waveforms.cpp | 41 | ||||
-rw-r--r-- | host/include/uhd/types/metadata.h | 10 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp.h | 4 | ||||
-rw-r--r-- | host/include/uhd/utils/soft_register.hpp | 2 | ||||
-rw-r--r-- | host/lib/transport/nirio/nirio_driver_iface_win.cpp | 5 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 5 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_io_impl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/common/max287x.hpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/kk_ihex_read.h | 6 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_uart.cpp | 8 | ||||
-rw-r--r-- | host/utils/octoclock_firmware_burner.cpp | 4 |
14 files changed, 63 insertions, 44 deletions
diff --git a/host/docs/usrp_e3x0.dox b/host/docs/usrp_e3x0.dox index db4114360..3c206195d 100644 --- a/host/docs/usrp_e3x0.dox +++ b/host/docs/usrp_e3x0.dox @@ -660,7 +660,7 @@ iface eth0 inet dhcp To configure a static IP address edit - /etc/hostname + /etc/network/interfaces to look like diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 942b5df7b..af8f92607 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -46,7 +46,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::set_thread_priority_safe(); //variables to be set by po - std::string args, wave_type, ant, subdev, ref, otw, channel_list; + std::string args, wave_type, ant, subdev, ref, pps, otw, channel_list; size_t spb; double rate, freq, gain, wave_freq, bw; float ampl; @@ -66,7 +66,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("bw", po::value<double>(&bw), "analog frontend filter bandwidth in Hz") ("wave-type", po::value<std::string>(&wave_type)->default_value("CONST"), "waveform type (CONST, SQUARE, RAMP, SINE)") ("wave-freq", po::value<double>(&wave_freq)->default_value(0), "waveform frequency in Hz") - ("ref", po::value<std::string>(&ref)->default_value("internal"), "clock reference (internal, external, mimo)") + ("ref", po::value<std::string>(&ref)->default_value("internal"), "clock reference (internal, external, mimo, gpsdo)") + ("pps", po::value<std::string>(&pps), "PPS source (internal, external, mimo, gpsdo)") ("otw", po::value<std::string>(&otw)->default_value("sc16"), "specify the over-the-wire sample mode") ("channels", po::value<std::string>(&channel_list)->default_value("0"), "which channels to use (specify \"0\", \"1\", \"0,1\", etc)") ("int-n", "tune USRP with integer-N tuning") @@ -179,15 +180,33 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::vector<std::complex<float> *> buffs(channel_nums.size(), &buff.front()); std::cout << boost::format("Setting device timestamp to 0...") << std::endl; - if (channel_nums.size() > 1) { - // This is the worst-case setup scenario, because this example has to - // work for all configurations. set_time_now() and set_time_next_pps() - // might also work, depending on what USRPs are being used, and can - // accelerate the setup. To keep this example generic, we use - // set_time_unknown_pps() to guarantee synchronization. - usrp->set_time_unknown_pps(uhd::time_spec_t(0.0)); - } else { - usrp->set_time_now(uhd::time_spec_t(0.0)); + if (channel_nums.size() > 1) + { + // Sync times + if (pps == "mimo") + { + UHD_ASSERT_THROW(usrp->get_num_mboards() == 2); + + //make mboard 1 a slave over the MIMO Cable + usrp->set_time_source("mimo", 1); + + //set time on the master (mboard 0) + usrp->set_time_now(uhd::time_spec_t(0.0), 0); + + //sleep a bit while the slave locks its time to the master + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + } + else + { + if (pps == "internal" or pps == "external" or pps == "gpsdo") + usrp->set_time_source(pps); + usrp->set_time_unknown_pps(uhd::time_spec_t(0.0)); + boost::this_thread::sleep(boost::posix_time::seconds(1)); //wait for pps sync pulse + } + } + else + { + usrp->set_time_now(0.0); } //Check Ref and LO Lock detect diff --git a/host/include/uhd/types/metadata.h b/host/include/uhd/types/metadata.h index 0cdbc6a72..37758e16a 100644 --- a/host/include/uhd/types/metadata.h +++ b/host/include/uhd/types/metadata.h @@ -164,7 +164,7 @@ UHD_API uhd_error uhd_rx_metadata_out_of_sequence( * * \param h metadata handle * \param pp_string_out string buffer for pp_string - * \param buffer length + * \param strbuffer_len buffer length */ UHD_API uhd_error uhd_rx_metadata_to_pp_string( uhd_rx_metadata_handle h, @@ -190,7 +190,7 @@ UHD_API uhd_error uhd_rx_metadata_error_code( * * \param h metadata handle * \param strerror_out string buffer for strerror - * \param buffer length + * \param strbuffer_len buffer length */ UHD_API uhd_error uhd_rx_metadata_strerror( uhd_rx_metadata_handle h, @@ -210,7 +210,7 @@ UHD_API uhd_error uhd_rx_metadata_strerror( * * \param h metadata handle * \param error_out string buffer for error - * \param buffer length + * \param strbuffer_len buffer length */ UHD_API uhd_error uhd_rx_metadata_last_error( uhd_rx_metadata_handle h, @@ -269,7 +269,7 @@ UHD_API uhd_error uhd_tx_metadata_end_of_burst( * * \param h metadata handle * \param error_out string buffer for error - * \param buffer length + * \param strbuffer_len buffer length */ UHD_API uhd_error uhd_tx_metadata_last_error( uhd_tx_metadata_handle h, @@ -349,7 +349,7 @@ UHD_API uhd_error uhd_async_metadata_user_payload( * * \param h metadata handle * \param error_out string buffer for error - * \param buffer length + * \param strbuffer_len buffer length */ UHD_API uhd_error uhd_async_metadata_last_error( uhd_async_metadata_handle h, diff --git a/host/include/uhd/usrp/usrp.h b/host/include/uhd/usrp/usrp.h index 1bde694b4..67f8e0f70 100644 --- a/host/include/uhd/usrp/usrp.h +++ b/host/include/uhd/usrp/usrp.h @@ -155,7 +155,7 @@ UHD_API uhd_error uhd_rx_streamer_max_num_samps( * * \param h RX streamer handle * \param buffs pointer to buffers in which to receive samples - * \param samps_per_buffer max number of samples per buffer + * \param samps_per_buff max number of samples per buffer * \param md handle to RX metadata in which to receive results * \param timeout timeout in seconds to wait for a packet * \param one_packet send a single packet @@ -235,7 +235,7 @@ UHD_API uhd_error uhd_tx_streamer_max_num_samps( * * \param h TX streamer handle * \param buffs pointer to buffers containing samples to send - * \param samps_per_buffer max number of samples per buffer + * \param samps_per_buff max number of samples per buffer * \param md handle to TX metadata * \param timeout timeout in seconds to wait for a packet * \param items_sent pointer to output variable for number of samples send diff --git a/host/include/uhd/utils/soft_register.hpp b/host/include/uhd/utils/soft_register.hpp index 9006ab5c7..a2c34a4ec 100644 --- a/host/include/uhd/utils/soft_register.hpp +++ b/host/include/uhd/utils/soft_register.hpp @@ -649,7 +649,7 @@ public: BOOST_FOREACH(const soft_regmap_accessor_t* db, _regmap_dbs) { try { return db->lookup(newpath.substr(1)); - } catch (std::exception& e) { + } catch (std::exception&) { continue; } } diff --git a/host/lib/transport/nirio/nirio_driver_iface_win.cpp b/host/lib/transport/nirio/nirio_driver_iface_win.cpp index b47c6ce85..717923176 100644 --- a/host/lib/transport/nirio/nirio_driver_iface_win.cpp +++ b/host/lib/transport/nirio/nirio_driver_iface_win.cpp @@ -1,5 +1,5 @@ // -// Copyright 2013 Ettus Research LLC +// Copyright 2013,2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -60,14 +60,13 @@ nirio_status rio_ioctl( * DeviceIoControl, even when doing synchronous IO. */ OVERLAPPED zeroedOverlapped = {0}; DWORD outLen = 0; - int_fast32_t lastError = 0; if (!(DeviceIoControl(device_handle, ioctl_code, const_cast<void*>(write_buf), static_cast<DWORD>(write_buf_len), read_buf, static_cast<DWORD>(read_buf_len), &outLen, &zeroedOverlapped ))) { - lastError = GetLastError(); + int_fast32_t lastError = GetLastError(); return NiRio_Status_SoftwareFault; } diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 6bd49e013..12baa1c14 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -227,7 +227,7 @@ static device_addrs_t b200_find(const device_addr_t &hint) try { // Turn the 16-Bit product ID into a string representation new_addr["product"] = B2XX_STR_NAMES[get_b200_product(handle, mb_eeprom)]; - } catch (const uhd::runtime_error &e) { + } catch (const uhd::runtime_error &) { // No problem if this fails -- this is just device discovery, after all. new_addr["product"] = "B2??"; } @@ -258,7 +258,8 @@ static device::sptr b200_make(const device_addr_t &device_addr) try { return device::sptr(new b200_impl(device_addr, handle)); } - catch (const uhd::usb_error &e) { + catch (const uhd::usb_error &) { + UHD_MSG(status) << "Detected bad USB state; resetting." << std::flush; libusb::device_handle::sptr dev_handle(libusb::device_handle::get_cached_handle( boost::static_pointer_cast<libusb::special_handle>(handle)->get_device() )); diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp index 4aa1a46af..7fcd04823 100644 --- a/host/lib/usrp/b200/b200_io_impl.cpp +++ b/host/lib/usrp/b200/b200_io_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright 2012-2014 Ettus Research LLC +// Copyright 2012-2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -135,7 +135,7 @@ void b200_impl::set_auto_tick_rate( if (!uhd::math::frequencies_are_equal(_tree->access<double>("/mboards/0/tick_rate").get(), new_rate)) { _tree->access<double>("/mboards/0/tick_rate").set(new_rate); } - } catch (const uhd::value_error &e) { + } catch (const uhd::value_error &) { UHD_MSG(warning) << "Cannot automatically determine an appropriate tick rate for these sampling rates." << std::endl << "Consider using different sampling rates, or manually specify a suitable master clock rate." << std::endl; diff --git a/host/lib/usrp/common/max287x.hpp b/host/lib/usrp/common/max287x.hpp index d084dcfbe..fe5da195c 100644 --- a/host/lib/usrp/common/max287x.hpp +++ b/host/lib/usrp/common/max287x.hpp @@ -412,7 +412,7 @@ double max287x<max287x_regs_t>::set_frequency( (128, max287x_regs_t::RF_DIVIDER_SELECT_DIV128); //map mode setting to valid integer divider (N) values - static const uhd::range_t int_n_mode_div_range(16,65536,1); + static const uhd::range_t int_n_mode_div_range(16,65535,1); static const uhd::range_t frac_n_mode_div_range(19,4091,1); //other ranges and constants from MAX287X datasheets @@ -486,13 +486,13 @@ double max287x<max287x_regs_t>::set_frequency( //keep N within int divider requirements if(is_int_n) { - if(N < int_n_mode_div_range.start()) continue; - if(N > int_n_mode_div_range.stop()) continue; + if(N <= int_n_mode_div_range.start()) continue; + if(N >= int_n_mode_div_range.stop()) continue; } else { - if(N < frac_n_mode_div_range.start()) continue; - if(N > frac_n_mode_div_range.stop()) continue; + if(N <= frac_n_mode_div_range.start()) continue; + if(N >= frac_n_mode_div_range.stop()) continue; } //keep pfd freq low enough to achieve 50kHz BS clock @@ -772,7 +772,7 @@ void max287x<max287x_regs_t>::commit() if (changed_regs.find(boost::uint32_t(addr)) != changed_regs.end()) regs.push_back(_regs.get_reg(boost::uint32_t(addr))); } - } catch (uhd::runtime_error& e) { + } catch (uhd::runtime_error&) { // No saved state - write all regs for (int addr = 5; addr >= 0; addr--) regs.push_back(_regs.get_reg(boost::uint32_t(addr))); diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index be98f4027..17a564f21 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -242,7 +242,7 @@ public: UHD_MSG(warning) << "Attempting to set filter on E300 in network mode." << std::endl; } - void output_digital_test_tone(bool enb) + void output_digital_test_tone(UHD_UNUSED(bool enb)) { UHD_THROW_INVALID_CODE_PATH(); } diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 2b6768079..f57556a8b 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -749,7 +749,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) //////////////////////////////////////////////////////////////////// // front panel gpio //////////////////////////////////////////////////////////////////// - mb.fp_gpio = gpio_core_200::make(mb.radio_perifs[0].ctrl, radio::sr_addr(radio::GPIO), radio::RB32_FP_GPIO); + mb.fp_gpio = gpio_core_200::make(mb.radio_perifs[0].ctrl, radio::sr_addr(radio::FP_GPIO), radio::RB32_FP_GPIO); BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map) { _tree->create<boost::uint32_t>(mb_path / "gpio" / "FP0" / attr.second) diff --git a/host/lib/usrp_clock/octoclock/kk_ihex_read.h b/host/lib/usrp_clock/octoclock/kk_ihex_read.h index 5e210fddb..303622b18 100644 --- a/host/lib/usrp_clock/octoclock/kk_ihex_read.h +++ b/host/lib/usrp_clock/octoclock/kk_ihex_read.h @@ -54,11 +54,11 @@ void ihex_begin_read(struct ihex_state * const ihex); // Begin reading at `address` (the lowest 16 bits of which will be ignored); // this is required only if the high bytes of the 32-bit starting address // are not specified in the input data and they are non-zero -void ihex_read_at_address(struct ihex_state *ihex, +void ihex_read_at_address(struct ihex_state * const ihex, ihex_address_t address); // Read a single character -void ihex_read_byte(struct ihex_state *ihex, char chr, FILE* outfile); +void ihex_read_byte(struct ihex_state * const ihex, const char byte, FILE* outfile); // Read `count` bytes from `data` void ihex_read_bytes(struct ihex_state * ihex, @@ -67,7 +67,7 @@ void ihex_read_bytes(struct ihex_state * ihex, FILE* outfile); // End reading (may call `ihex_data_read` if there is data waiting) -void ihex_end_read(struct ihex_state *ihex, FILE* outfile); +void ihex_end_read(struct ihex_state * const ihex, FILE* outfile); // Called when a complete line has been read, the record type of which is // passed as `type`. The `ihex` structure will have its fields `data`, diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp index e879c4b70..f366bac30 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp @@ -1,5 +1,5 @@ // -// Copyright 2014 Ettus Research LLC +// Copyright 2014-2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -91,7 +91,7 @@ namespace uhd{ while(boost::get_system_time() < exit_time){ _update_cache(); - for(char ch = _getchar(); ch != -1; ch = _getchar()){ + for(char ch = _getchar(); ch != 0; ch = _getchar()){ if(ch == '\r') continue; //Skip carriage returns _rxbuff += ch; @@ -111,7 +111,7 @@ namespace uhd{ void octoclock_uart_iface::_update_cache(){ octoclock_packet_t pkt_out; pkt_out.len = 0; - pkt_out.sequence = 0; + pkt_out.sequence = 0; size_t len = 0; boost::uint8_t octoclock_data[udp_simple::mtu]; @@ -146,7 +146,7 @@ namespace uhd{ char octoclock_uart_iface::_getchar(){ if(LOCAL_STATE_AHEAD){ - return -1; + return 0; } char ch = _cache[_state.pos]; diff --git a/host/utils/octoclock_firmware_burner.cpp b/host/utils/octoclock_firmware_burner.cpp index 272394860..c338cd818 100644 --- a/host/utils/octoclock_firmware_burner.cpp +++ b/host/utils/octoclock_firmware_burner.cpp @@ -273,7 +273,7 @@ bool reset_octoclock(const std::string &ip_addr){ throw uhd::runtime_error("Failed to place device in state to receive firmware."); } - boost::this_thread::sleep(boost::posix_time::milliseconds(3000)); + boost::this_thread::sleep(boost::posix_time::milliseconds(500)); return (bootloader_find(ip_addr).size() == 1); } @@ -416,7 +416,7 @@ int UHD_SAFE_MAIN(UHD_UNUSED(int argc), UHD_UNUSED(char *argv[])){ std::cout << "done." << std::endl; std::cout << "Waiting for OctoClock to reinitialize..." << std::flush; - boost::this_thread::sleep(boost::posix_time::milliseconds(5000)); + boost::this_thread::sleep(boost::posix_time::milliseconds(500)); octoclocks = device::find(str(boost::format("addr=%s") % ip_addr), device::CLOCK); if(octoclocks.size() == 1){ if(octoclocks[0]["type"] == "octoclock-bootloader"){ |