diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-05-30 13:46:24 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:10 -0800 |
commit | 4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d (patch) | |
tree | 5186c357e2923023366adca2cb83fd81e66416ec /host/lib/usrp | |
parent | e250da5003bcc7a7068e54b11ba86e51563255be (diff) | |
download | uhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.tar.gz uhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.tar.bz2 uhd-4d5ae0cc69424ecc9a7fcc0943d22832e5f37b8d.zip |
lib: utils: Add new signature to get_freq_and_freq_word()
The new signature uses tuple as the return value, instead of passing in
output variables as references (C-style).
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/cores/dsp_core_utils.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/host/lib/usrp/cores/dsp_core_utils.cpp b/host/lib/usrp/cores/dsp_core_utils.cpp index 282073597..44885bc6f 100644 --- a/host/lib/usrp/cores/dsp_core_utils.cpp +++ b/host/lib/usrp/cores/dsp_core_utils.cpp @@ -54,3 +54,11 @@ void get_freq_and_freq_word( actual_freq = (double(freq_word) / scale_factor) * tick_rate; } +std::tuple<double, int> get_freq_and_freq_word(const double requested_freq, const double tick_rate) +{ + double actual_freq; + int32_t freq_word; + get_freq_and_freq_word(requested_freq, tick_rate, actual_freq, freq_word); + return std::make_tuple(actual_freq, freq_word); +} + |