summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-03-31 19:59:50 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-03-31 19:59:50 +0000
commitcff07c304dddfc8077d0921f01131329c5967dd9 (patch)
tree97192d5ad45ccd3fb216b9fb74562b26c81ce374
parentc19466a2fac938a8be2c78d78abe19b4287b4e61 (diff)
downloadrockbox-cff07c304dddfc8077d0921f01131329c5967dd9.tar.gz
rockbox-cff07c304dddfc8077d0921f01131329c5967dd9.zip
Fix FS#11152 in a cleaner way. At least on the sim, the state remained in FMRADIO_PLAYING forever after r25403, which broke (at least) the playback mode display in skins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25408 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/radio.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index e6e51d976c..0523f1ecac 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -127,8 +127,7 @@ static int curr_freq; /* current frequency in Hz */
127static int radio_mode = RADIO_SCAN_MODE; 127static int radio_mode = RADIO_SCAN_MODE;
128static int search_dir = 0; 128static int search_dir = 0;
129 129
130/* make sure that radio_stop() does a full run after rockbox boots */ 130static int radio_status = FMRADIO_OFF;
131static int radio_status = FMRADIO_PLAYING;
132static bool in_screen = false; 131static bool in_screen = false;
133 132
134#define MAX_PRESETS 64 133#define MAX_PRESETS 64
@@ -148,6 +147,7 @@ static int load_preset_list(void);
148static int clear_preset_list(void); 147static int clear_preset_list(void);
149 148
150static int scan_presets(void *viewports); 149static int scan_presets(void *viewports);
150static void radio_off(void);
151 151
152/* Function to manipulate all yesno dialogues. 152/* Function to manipulate all yesno dialogues.
153 This function needs the output text as an argument. */ 153 This function needs the output text as an argument. */
@@ -165,7 +165,7 @@ static bool yesno_pop(const char* text)
165void radio_init(void) 165void radio_init(void)
166{ 166{
167 tuner_init(); 167 tuner_init();
168 radio_stop(); 168 radio_off();
169} 169}
170 170
171int get_radio_status(void) 171int get_radio_status(void)
@@ -256,15 +256,20 @@ void radio_pause(void)
256 radio_status = FMRADIO_PAUSED; 256 radio_status = FMRADIO_PAUSED;
257} /* radio_pause */ 257} /* radio_pause */
258 258
259void radio_stop(void) 259static void radio_off(void)
260{ 260{
261 if(radio_status == FMRADIO_OFF)
262 return;
263
264 tuner_set(RADIO_MUTE, 1); 261 tuner_set(RADIO_MUTE, 1);
265 tuner_set(RADIO_SLEEP, 1); /* low power mode, if available */ 262 tuner_set(RADIO_SLEEP, 1); /* low power mode, if available */
266 radio_status = FMRADIO_OFF; 263 radio_status = FMRADIO_OFF;
267 tuner_power(false); /* status update, power off if avail. */ 264 tuner_power(false); /* status update, power off if avail. */
265}
266
267void radio_stop(void)
268{
269 if(radio_status == FMRADIO_OFF)
270 return;
271
272 radio_off();
268} /* radio_stop */ 273} /* radio_stop */
269 274
270bool radio_hardware_present(void) 275bool radio_hardware_present(void)