Commit graph

37 commits

Author SHA1 Message Date
Martin Braun
652873b664 examples: Improve txrx_loopback_to_file (late recv, Boost, timing)
- Fixes a bug where the RX stream command set set independent of the
  device time. Now, we read back get_time_now() to calculate the command
  time.
- When using multiple RX USRPs, sync their times. Before, they were left
  untouched, causing possible timing mismatches.
- Increase the initial timeout value. The previous value had only been
  tested with N2x0.
- Replace the boost::thread_group with a std::thread.
- Remove some boost::format where it didn't add value.
2021-09-17 13:27:17 -07:00
Martin Braun
188fbb17cf uhd: Remove all occurences of boost::math::*round()
Its behaviour is almost identical to std::lround, which we use instead.
The only downside of std::lround is that it always returns a long, which
we don't always need. We thus add some casts for those cases to make the
compiler happy.
2021-06-24 12:00:49 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
d3a16b7022 uhd: Replace all occurrences of boost::bind with std::bind
Note: Replacing everything with a lambda would be even better, but that
can't be easily scripted so we'll do this as a first step to reduce the
Boost footprint.

This also removes occurences of #include <boost/bind.hpp>, and makes
sure all usages of std::bind have an #include <functional>. clang-format
wasn't always applied to minimize the changeset in this commit, however,
it was applied to the blocks of #includes.

Due to conflicts with other Boost libraries, the placeholders _1, _2,
etc. could not be directly used, but had to be explicitly called out
(as std::placeholders::_1, etc.). This makes the use of std::bind even
uglier, which serves as another reminder that using std::bind (and even
more so, boost::bind) should be avoided.

nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It
was not possible to remove it by simply doing a search and replace, so
it will be removed in a separate commit.
2019-11-26 12:21:32 -08:00
Martin Braun
1fe98e8701 uhd: Replace usage of boost smart pointers with C++11 counterparts
This removes the following Boost constructs:
- boost::shared_ptr, boost::weak_ptr
- boost::enable_shared_from_this
- boost::static_pointer_cast, boost::dynamic_pointer_cast

The appropriate includes were also removed. All C++11 versions of these
require #include <memory>.
Note that the stdlib and Boost versions have the exact same syntax, they
only differ in the namespace (boost vs. std). The modifications were all
done using sed, with the exception of boost::scoped_ptr, which was
replaced by std::unique_ptr.

References to boost::smart_ptr were also removed.

boost::intrusive_ptr is not removed in this commit, since it does not
have a 1:1 mapping to a C++11 construct.
2019-11-26 12:21:32 -08:00
natetemple
d3e1d6e9be Examples: wrap up ref setting with option check 2019-11-24 16:56:27 -08:00
Ciro Nishiguchi
60a70f7142 examples: remove thread priority elevation
Remove UHD call to elevate thread priority to realtime. Setting all
threads to the same realtime priority can cause the threads to not share
access to the network interface fairly, which adversely affects
operation of the worker threads in UHD.
2019-10-22 16:18:46 -07:00
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Brent Stapleton
601e0ed87b examples: utils: skip formatting program options
Turning off clang formatting around the program option declarations.
clang-format makes them looks bad an unreadable because it thinks the
options are function calls or something.
2019-01-16 11:40:23 -08:00
Mark Meserve
4ecb817f2c uhd: fix rx antenna not being applied in txrx example 2018-11-16 16:41:59 -08:00
Daniel Jepson
0bcae6cb16 uhd: update settling time to double in txrx_loopback_to_file example 2018-04-10 09:58:34 -07:00
Daniel Jepson
dce94c60f7 uhd: increase tx buffer fill time for txrx_loopback_to_file example
The previous 0.1s fill time occasionally prevented rx from starting on time when
settling is set to the same 0.1s time. It was increased to 0.5s.
2018-04-10 09:58:34 -07:00
Daniel Jepson
c75edc1d48 uhd: fix subdevice selection order in txrx_loopback_to_file example 2018-04-10 09:58:34 -07:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Andrej Rode
c33928d2bb utils: add set_thread_name API call, move thread_priority to thread 2017-06-29 13:43:05 -07:00
Martin Braun
47cdd6319c uhd: Replaced many lexical_cast with appropriate C++11 equivalents 2017-06-29 13:40:07 -07:00
Paul David
7b268bdb82 examples: TX/RX loopback stopping condition was reversed
No data was getting stored.
2016-03-03 16:13:20 -08:00
DaulPavid
a9de87e33d examples: TX/RX loopback could run forever if the exact number of samples isn't received 2016-03-03 12:37:18 -08:00
Martin Braun
2e594ae877 Merge branch 'maint'
Conflicts:
	host/include/uhd/transport/vrt_if_packet.hpp
2015-03-11 17:05:10 -07:00
Martin Braun
cc7d37f114 uhd: Fixed several type-cast related warnings for naggy compilers 2015-03-11 16:58:23 -07:00
Martin Braun
8086c2e32c Merge branch 'maint'
Conflicts:
	host/examples/rx_samples_to_file.cpp
2015-02-12 11:04:29 +01:00
Rajib Bhattacharjea
4dc4c3cd70 examples: Show set_rx_bandwidth units properly in MHz in all examples
Conflicts:
	host/examples/rx_samples_to_file.cpp
2015-02-09 13:36:02 +01:00
Martin Braun
d9e7a42d51 Merge branch 'maint' 2015-01-08 15:19:20 +01:00
Martin Braun
1cc94c31ab examples: Fixed multi-channel gain and freq setup for txrx_loopback_to_file 2015-01-08 15:10:07 +01:00
Martin Braun
84e1e3c9ce Merge branch 'maint'
Conflicts:
	host/examples/rx_samples_to_file.cpp
2014-12-15 11:27:02 +01:00
Marcus Müller
125820ea68 host/examples: rm'ed refs to d'boards, IF freq.
To reflect a reality where some USRPs don't have daughterboards,
and set_xx_bandwidth doesn't necessarily set an /IF/ bandwidth.
2014-12-12 11:37:53 +01:00
Martin Braun
360c0e5c77 examples: Fixed multi-channel ops 2014-11-13 01:17:14 +01:00
Martin Braun
ecd3d91b55 examples: Fixed multi-channel ops 2014-11-12 08:54:19 +01:00
Martin Braun
10ff484ccb examples: Whitespace and other cleanup 2014-10-28 19:42:22 +01:00
Martin Braun
853901782f uhd: Added nicer error reporting to rx examples 2014-04-10 21:26:39 +02:00
Ben Hilburn
ff1546f813 Pushing the bulk of UHD-3.7.0 code. 2014-02-14 12:05:07 -08:00
Nicholas Corgan
6cdc9cdd5b 120 MHz daughterboard support, Integer-N tuning, ADF435x code consolidation
* Added support for new CBX-120, SBX-120, and WBX-120 daughterboards
* Added implementation of Integer-N tuning for all CBX, SBX, and WBX daughterboards
* Added --int-n option to examples to show how to use Integer-N tuning API
* Removed duplicate ADF4350/ADF4351 code and moved it to common/adf435x_common.cpp
2014-01-24 07:17:42 -08:00
Nicholas Corgan
96e50aebb7 examples: changed examples that force usage of all channels to allow user to input which channels to use 2013-08-26 16:04:18 -07:00
Josh Blum
c464a63e87 uhd: added new calls to streamer object + support work
* The transmit streamer gives access to the async msg queue.
* The receive streamer gives access to the issue stream cmd.
* Supporting usrp implementation files updated.
* Example applications updated to use this API.
2013-07-15 15:44:42 -07:00
Moritz Fischer
171e46cebe examples & utils: return EXIT_FAILURE and EXIT_SUCCESS respectively
instead of 0 and 1.
2012-10-26 14:00:29 -07:00
Jason Abele
2d5d41f213 Created example for simultaneous transmit and receive to file
Updates to allow rx to wait until tx settles
2012-05-14 11:51:11 -07:00