Commit graph

69 commits

Author SHA1 Message Date
Martin Braun
f646ff838b examples: Move setup time in tx_waveforms after tuning
This avoids potential LO-lock-detect failures.
2024-06-28 13:16:32 +02:00
Lars Amsel
4289cc1eef examples: Don't do timed commands for X410 in tx_waveform examples
X410 cannot reliably tune using timed command. Therefore explicitly
disable that in TX examples for X410.
2024-06-26 14:49:20 +02:00
Sheikh Usman Ali
ad35a0f4eb example: cpp: Fix bug error lo_locked.to_bool()
Moved Code block section for clock sync setup block from later stage to
 earlier stage before check Ref and LO Lock detect block. Specifically
 moved `//clock sync setup is complete do timed tuning of LOs and NCOs`
 section.

This helped resolve the `Error: AssertionError: lo_locked.to_bool()`
2024-06-11 10:20:08 +02:00
Marian Koop
de1542331f example: cpp: Changed setting frequency to use time commands
Modified example to support demonstratig the X440 phase repeatability
performance. Change is compatible with all supported devices, but only
improves phase repeatability performance of X440.

Separated loops configuring radio properties and converted setting carrier
frequency into timed commands. This required moving this code to a later
part in the programming flow, after all the clock source settings are
applied and the LO locks are confirmed.
2024-06-11 10:20:08 +02:00
Joel Keeling
e01adabf99 examples: Improve tx examples and fix some issues
- tx_waveforms fixes:
  - Fixed power bug. Changed loop style to 'for each' in order to avoid this
    issue in the future
- tx_samples_from_file:
  - Fixed bug where channels 1 and higher could not be configured correctly.
  - Added the 'power' argument.
  - Added support for multiple channels.
  - Re-added 'channel' argument for backwards compatibility.
  - Added additional error checking.
  - Changed help descriptions to match other example apps.
2023-12-04 11:41:46 -06:00
Martin Braun
ebd5dd03cf Apply clang-formatting to all C/C++ files
- Used clang-format version 14
- Ran ./tools/clang-formatter.sh apply
2023-08-07 15:35:56 -05:00
Martin Braun
e398d13d67 examples: Remove default --ref and --pps values
This changes the behaviour of the examples in a way that leaving
out the --ref argument will not force it to be 'internal'. Previously,
the following command:

    rx_samples_to_file --args type=xxx,clock_source=external

would still use the internal reference, because the default value for
--ref was internal, and no other value for --ref was provided. Even
worse, the following command:

    rx_samples_to_file --args \
        type=xxx,clock_source=external,time_source=external

might throw errors/warnings, because internal clock source plus external
time source is generally not supported, and the example would force the
clock source to be internal unless `--ref internal` was also provided.

For all cases that `clock_source` or `time_source` were not given as
a device argument, this is a no-op because `internal` is the default
value anyway.

In two examples, this includes minor code changes:
- In rfnoc_radio_loopback, if both --ref and --pps were given, we now
  use set_sync_source() to speed up setting the reference sources. On
  the N310/N300 series in particular, this saves a few seconds at
  initialization over the previous implementation (which set clock and
  time reference separately).
- In test_dboard_coercion, the code would fail without a default value
  for --ref, so we no longer require such a default value.
2023-05-19 08:52:20 -05: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
261ee6d677 examples: Add --power command line option to tx_waveforms
If you run

    tx_waveforms --power -20 [other args]

it will try to set the out power to -20 dBm. The signal amplitude is
factored in, so changing --ampl will not change the actual TX power
unless it causes clipping, or becomes too low.

If the USRP does not support setting a power, the program will terminate
early. If it does support setting a power, but can't reach the requested
power, it will coerce, and print the actual, available power.
2020-04-17 07:59:50 -05: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
Derek Kozel
8027df7a22 examples: Improved error message in tx_waveforms
Non-CONST type waveforms require a non-zero wave freq
2019-01-14 10:24:08 -08:00
natetemple
a476cba5f5 Examples: Add lo-offset to tx_waveforms 2019-01-10 09:47:33 -08:00
Brent Stapleton
aa1ec63537 examples: optimize tx_waveforms memory allocations
Move filling the TX buffer outside the critical path. Now, we pre-fill
the TX buffer before entering the send loop (and before setting the
TX stream time), and fill the TX buffer after calling send() (for the
next iteration).
2019-01-03 09:20:18 -08:00
Brent Stapleton
7d34f4d2c8 examples: formatting in tx_waveforms
- Format `if` statements to multiple lines
- Add quick comment on the exit checks
2019-01-03 09:20:18 -08:00
Sugandha Gupta
c661c352ca examples: Select subdev spec before setting channels 2018-06-12 06:48:59 -07:00
Martin Braun
0303f1ed55 lib: Purge all references to boost::this_thread::sleep()
Replace with std::this_thread::sleep_for().
2018-04-30 17:10:26 -07:00
Martin Braun
305d0e79e2 examples: Fix some minor compiler warnings
All warnings reported by MSVC. Mostly related to narrowing conversions.
2018-02-19 17:01:40 -08: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
Andrej Rode
26cc20847c uhd: replace BOOST_FOREACH with C++11 range-based for loop
Note: This is the first commit that uses for-range, and range-based
for-loops are now usable for UHD development.
2017-02-10 16:44:33 -08:00
Martin Braun
62898fc131 examples: tx_waveforms was always checking lo_lock on channel 0, regardless of channel used 2016-08-11 09:59:24 -07:00
Paul David
2bdc0e2e31 examples: added options for specifying number of samples to transmit 2016-04-04 16:57:59 -07:00
michael-west
0d290169f2 UHD: Add pps source option to tx_waveforms example 2015-09-01 13:33:16 -07:00
Martin Braun
7c6bc34f62 Merge branch 'maint'
Conflicts:
	fpga-src
	host/CMakeLists.txt
	host/cmake/Modules/UHDVersion.cmake
	host/lib/usrp/b200/b200_impl.hpp
	host/lib/usrp/e300/e300_fpga_defs.hpp
	host/lib/usrp/x300/x300_fw_common.h
2015-07-14 14:51:14 -07:00
Martin Braun
1c185f8478 examples: Improved tx_waveform multi-channel sync 2015-07-14 12:19:41 -07: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
10ff484ccb examples: Whitespace and other cleanup 2014-10-28 19:42:22 +01:00
Moritz Fischer
198a0e2d9c examples: Minor change to tx_waveforms example.
Signed-off-by: Moritz Fischer <moritz@ettus.com>
2014-10-07 12:09:37 +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
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
Josh Blum
d7a3534611 uhd: added setup sleep to tx waveforms 2012-03-23 14:36:56 -07:00
Josh Blum
4a27f6e4bd uhd: add over-the-wire option to tx waveforms 2012-02-12 14:38:35 -08:00
Josh Blum
1b2108274a uhd: typo fix in tx waveforms options 2012-01-03 11:22:42 -08:00
Josh Blum
74106084ed uhd: simplification for tx waveforms 2011-11-11 11:55:04 -08:00
Josh Blum
f152764e4b uhd: updated ref sensor checks for new option names 2011-11-10 10:27:54 -08:00
Josh Blum
c29adad91e uhd: performance improvement for tx waveforms using integer table lookup 2011-11-10 10:23:05 -08:00
Josh Blum
7c503ad1fa uhd: modify examples to use new time/clock source API 2011-11-07 14:34:40 -08:00
Josh Blum
f3afd2eb94 uhd: performance speed up for tx waveforms, no iterative libmath per sample 2011-11-06 14:53:52 -08:00
Josh Blum
fac15db5d7 uhd: renamed some of the stream types and functions 2011-11-03 20:37:11 -07:00
Josh Blum
a629bbe7e3 uhd: updated examples to use new streamer interface 2011-11-03 20:37:10 -07:00
Josh Blum
406ddc022c uhd: specify range on tx_waveforms --ampl 2011-10-10 17:48:46 -07:00
Jason Abele
539c9b5a55 Updates to example apps
Add --ref option to specify mboard clock reference source
    Add check for lock to mboard clock reference (where applicable)
    Add check of daughterboard LO lock detect (where applicable)
2011-09-21 16:03:46 -07:00