From eeba52edd7c5c8c0a86d2a8dc0eaab8ecae342b8 Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Wed, 18 Apr 2018 10:32:18 -0700 Subject: lib: update get_range of gain_group Need to skip zero gain step --- host/lib/utils/gain_group.cpp | 7 +++++-- 1 file 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); } -- cgit v1.2.3