summaryrefslogtreecommitdiff
path: root/software/rda1846dongle/rda1846_defines.h
diff options
context:
space:
mode:
Diffstat (limited to 'software/rda1846dongle/rda1846_defines.h')
-rw-r--r--software/rda1846dongle/rda1846_defines.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/software/rda1846dongle/rda1846_defines.h b/software/rda1846dongle/rda1846_defines.h
index 242df4e..ab4b496 100644
--- a/software/rda1846dongle/rda1846_defines.h
+++ b/software/rda1846dongle/rda1846_defines.h
@@ -182,10 +182,12 @@
#define RDA1846_DTMF_EN 0x0100
// DTMF tone freq
-#define dtmf_tone_freq_hz(value) (value/4.096)
-#define dtmf_tone_freq_value(hz) (hz*4.096)
+#include <math.h>
-// DTMF frequencies @ 12.288 MHz - these are defaults...
+#define dtmf_tone_freq_hz(value) (uint16_t)round(value/4.096)
+#define dtmf_tone_freq_value(hz) (uint16_t)round(hz*4.096)
+
+// DTMF frequencies @ 12.288 MHz - these are the defaults...
#define RDA1846_DTMF_C0 0x61 // 697 Hz
#define RDA1846_DTMF_C1 0x5B // 770 Hz
#define RDA1846_DTMF_C2 0x53 // 852 Hz