summaryrefslogtreecommitdiff
path: root/usrp2
diff options
context:
space:
mode:
authormatt2008-11-16 20:43:57 +0000
committermatt2008-11-16 20:43:57 +0000
commit0aa75fde365f501a68a1028aed9426add2267e5f (patch)
tree070ad4c2218393fd2ce4fc59f7e7c1c02de30679 /usrp2
parent28bbeb38f65ebe5b6422e52d31b359ddfac94fc2 (diff)
downloadgnuradio-0aa75fde365f501a68a1028aed9426add2267e5f.tar.gz
gnuradio-0aa75fde365f501a68a1028aed9426add2267e5f.tar.bz2
gnuradio-0aa75fde365f501a68a1028aed9426add2267e5f.zip
added a utility function to get the integer rounded gain
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9997 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2')
-rw-r--r--usrp2/firmware/include/usrp2_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/usrp2/firmware/include/usrp2_types.h b/usrp2/firmware/include/usrp2_types.h
index 83d9f26c7..dd2bcf1ed 100644
--- a/usrp2/firmware/include/usrp2_types.h
+++ b/usrp2/firmware/include/usrp2_types.h
@@ -99,6 +99,12 @@ u2_fxpt_gain_to_double(u2_fxpt_gain_t fx)
return ((double) fx) * 1.0/(1 << U2_FPG_RP);
}
+static inline int
+u2_fxpt_gain_round_to_int(u2_fxpt_gain_t fx)
+{
+ return (int)((fx+(1<<(U2_FPG_RP-1)))>>U2_FPG_RP);
+}
+
__U2_END_DECLS