From 0aa75fde365f501a68a1028aed9426add2267e5f Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 16 Nov 2008 20:43:57 +0000 Subject: 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 --- usrp2/firmware/include/usrp2_types.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'usrp2') 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 -- cgit