summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-05-03 23:56:51 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-05-03 23:56:51 +0000
commit93e47b922f38b2ab7a6b485361943b8566e56629 (patch)
treed67c45d8b3dcfff649f4fa6392d368c49120e677
parent23b0fdaca1061c86b2d8e71a9f281d5c3e13736b (diff)
downloadrockbox-93e47b922f38b2ab7a6b485361943b8566e56629.tar.gz
rockbox-93e47b922f38b2ab7a6b485361943b8566e56629.zip
Finer resolution for the PLL
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3646 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/radio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 4f6fca4fa3..839fafe303 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -33,6 +33,7 @@
#define MAX_FREQ (110000000)
#define MIN_FREQ (80000000)
+#define PLL_FREQ_STEP 10000
#define FREQ_STEP 100000
static int curr_freq = 99400000;
@@ -46,7 +47,7 @@ void fm_set_frequency(int freq)
** by 2.
*/
- pll_cnt = (freq + 10700000) / 50000 / 2;
+ pll_cnt = (freq + 10700000) / (PLL_FREQ_STEP/2) / 2;
/* 0x100000 == FM mode
** 0x000002 == Microprocessor controlled Mute
@@ -76,7 +77,7 @@ bool radio_screen(void)
mas_codec_writereg(6, 0x4000);
- fmradio_set(2, 0x108884); /* 50kHz, 7.2MHz crystal */
+ fmradio_set(2, 0x140884); /* 5kHz, 7.2MHz crystal */
fm_set_frequency(curr_freq);
while(!done)
@@ -133,7 +134,7 @@ bool radio_screen(void)
break;
case BUTTON_LEFT:
- curr_freq -= 100000;
+ curr_freq -= FREQ_STEP;
if(curr_freq < MIN_FREQ)
curr_freq = MIN_FREQ;
@@ -142,7 +143,7 @@ bool radio_screen(void)
break;
case BUTTON_RIGHT:
- curr_freq += 100000;
+ curr_freq += FREQ_STEP;
if(curr_freq > MAX_FREQ)
curr_freq = MAX_FREQ;