From 8784cf70df692066f224ddf58d624b148ea98301 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Wed, 28 Jul 2010 15:40:43 -0700 Subject: ADC gain control works. Separated digital gain and fine gain correction into separate buckets. Changed the rounding policy of gain_group to floor() rather than round(). --- host/lib/gain_group.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'host/lib/gain_group.cpp') diff --git a/host/lib/gain_group.cpp b/host/lib/gain_group.cpp index 5a14fa96f..d5d7730fd 100644 --- a/host/lib/gain_group.cpp +++ b/host/lib/gain_group.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,7 @@ public: //fill in the largest step sizes first that are less than the remainder BOOST_FOREACH(size_t i, indexes_step_size_dec){ const gain_range_t range = all_fcns.at(i).get_range(); - float additional_gain = range.step*rint( + float additional_gain = range.step*int( std::clip(gain_bucket.at(i) + gain_left_to_distribute, range.min, range.max )/range.step) - gain_bucket.at(i); gain_bucket.at(i) += additional_gain; -- cgit v1.2.3