summaryrefslogtreecommitdiff
path: root/apps/recorder/radio.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-12 13:28:44 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-12 13:28:44 +0000
commit3e92dbecc820d6ba4e31b6a4a766ed27c6e7b64b (patch)
tree3fda8523fd02e1e87dab69c78b63d100ef8f7a51 /apps/recorder/radio.c
parent7c0cdf19188081dba006d2df0334cf75ca0a471e (diff)
The FM radio screen now remembers the last used frequency
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4865 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/radio.c')
-rw-r--r--apps/recorder/radio.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index ce4bc8b4d6..00223a070e 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -68,7 +68,7 @@ static int fm_in1 = DEFAULT_IN1;
static int fm_in2 = DEFAULT_IN2;
static int curr_preset = -1;
-static int curr_freq = 99400000;
+static int curr_freq;
static int pll_cnt;
#define MAX_PRESETS 32
@@ -159,6 +159,12 @@ static int find_preset(int freq)
return -1;
}
+static void remember_frequency(void)
+{
+ global_settings.last_frequency = (curr_freq - MIN_FREQ) / FREQ_STEP;
+ settings_save();
+}
+
bool radio_screen(void)
{
char buf[MAX_PATH];
@@ -224,6 +230,8 @@ bool radio_screen(void)
mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN),
mpeg_sound_default(SOUND_RIGHT_GAIN), false);
#endif
+
+ curr_freq = global_settings.last_frequency * FREQ_STEP + MIN_FREQ;
fmradio_set(1, DEFAULT_IN1);
fmradio_set(2, DEFAULT_IN2);
@@ -266,6 +274,7 @@ bool radio_screen(void)
{
search_dir = 0;
curr_preset = find_preset(curr_freq);
+ remember_frequency();
}
update_screen = true;
@@ -322,6 +331,7 @@ bool radio_screen(void)
radio_set(RADIO_FREQUENCY, curr_freq);
curr_preset = find_preset(curr_freq);
+ remember_frequency();
search_dir = 0;
update_screen = true;
break;
@@ -333,6 +343,7 @@ bool radio_screen(void)
radio_set(RADIO_FREQUENCY, curr_freq);
curr_preset = find_preset(curr_freq);
+ remember_frequency();
search_dir = 0;
update_screen = true;
break;
@@ -765,6 +776,7 @@ bool handle_radio_presets(void)
i = menu_cursor(preset_menu);
curr_freq = presets[i].frequency;
radio_set(RADIO_FREQUENCY, curr_freq);
+ remember_frequency();
}
}