From a1a6c7034362d5c4935b729a12aa2a90f22827e7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 6 Mar 2013 04:08:12 +0000 Subject: rda1846dongle: fixed dtmf freq2val converters some more debug commands git-svn-id: https://svn.spreadspace.org/mur.sat@696 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/rda1846dongle/rda1846_defines.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'software/rda1846dongle/rda1846_defines.h') 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 -// 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 -- cgit v1.2.3