summaryrefslogtreecommitdiff
path: root/apps/recorder/radio.c
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 /apps/recorder/radio.c
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
Diffstat (limited to 'apps/recorder/radio.c')
-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 @@
33 33
34#define MAX_FREQ (110000000) 34#define MAX_FREQ (110000000)
35#define MIN_FREQ (80000000) 35#define MIN_FREQ (80000000)
36#define PLL_FREQ_STEP 10000
36#define FREQ_STEP 100000 37#define FREQ_STEP 100000
37 38
38static int curr_freq = 99400000; 39static int curr_freq = 99400000;
@@ -46,7 +47,7 @@ void fm_set_frequency(int freq)
46 ** by 2. 47 ** by 2.
47 */ 48 */
48 49
49 pll_cnt = (freq + 10700000) / 50000 / 2; 50 pll_cnt = (freq + 10700000) / (PLL_FREQ_STEP/2) / 2;
50 51
51 /* 0x100000 == FM mode 52 /* 0x100000 == FM mode
52 ** 0x000002 == Microprocessor controlled Mute 53 ** 0x000002 == Microprocessor controlled Mute
@@ -76,7 +77,7 @@ bool radio_screen(void)
76 77
77 mas_codec_writereg(6, 0x4000); 78 mas_codec_writereg(6, 0x4000);
78 79
79 fmradio_set(2, 0x108884); /* 50kHz, 7.2MHz crystal */ 80 fmradio_set(2, 0x140884); /* 5kHz, 7.2MHz crystal */
80 fm_set_frequency(curr_freq); 81 fm_set_frequency(curr_freq);
81 82
82 while(!done) 83 while(!done)
@@ -133,7 +134,7 @@ bool radio_screen(void)
133 break; 134 break;
134 135
135 case BUTTON_LEFT: 136 case BUTTON_LEFT:
136 curr_freq -= 100000; 137 curr_freq -= FREQ_STEP;
137 if(curr_freq < MIN_FREQ) 138 if(curr_freq < MIN_FREQ)
138 curr_freq = MIN_FREQ; 139 curr_freq = MIN_FREQ;
139 140
@@ -142,7 +143,7 @@ bool radio_screen(void)
142 break; 143 break;
143 144
144 case BUTTON_RIGHT: 145 case BUTTON_RIGHT:
145 curr_freq += 100000; 146 curr_freq += FREQ_STEP;
146 if(curr_freq > MAX_FREQ) 147 if(curr_freq > MAX_FREQ)
147 curr_freq = MAX_FREQ; 148 curr_freq = MAX_FREQ;
148 149