summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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