diff options
author | Trung N Tran <trung.tran@ettus.com> | 2018-04-18 10:32:18 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-18 15:41:49 -0700 |
commit | eeba52edd7c5c8c0a86d2a8dc0eaab8ecae342b8 (patch) | |
tree | 9e8b69b7ce3b1ee833381870b81cc0473adde295 /host/lib/utils | |
parent | 13b45a08c90912e8baa33b618b152cf41293bb9d (diff) | |
download | uhd-eeba52edd7c5c8c0a86d2a8dc0eaab8ecae342b8.tar.gz uhd-eeba52edd7c5c8c0a86d2a8dc0eaab8ecae342b8.tar.bz2 uhd-eeba52edd7c5c8c0a86d2a8dc0eaab8ecae342b8.zip |
lib: update get_range of gain_group
Need to skip zero gain step
Diffstat (limited to 'host/lib/utils')
-rw-r--r-- | host/lib/utils/gain_group.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/host/lib/utils/gain_group.cpp b/host/lib/utils/gain_group.cpp index 46fa8a240..50edf2515 100644 --- a/host/lib/utils/gain_group.cpp +++ b/host/lib/utils/gain_group.cpp @@ -67,8 +67,11 @@ public: overall_min += range.start(); overall_max += range.stop(); //the overall step is the min (zero is invalid, first run) - if (overall_step == 0) overall_step = range.step(); - overall_step = std::min(overall_step, range.step()); + if (overall_step == 0){ + overall_step = range.step(); + }else if (range.step()){ + overall_step = std::min(overall_step, range.step()); + } } return gain_range_t(overall_min, overall_max, overall_step); } |