diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-03-31 19:59:50 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-03-31 19:59:50 +0000 |
commit | cff07c304dddfc8077d0921f01131329c5967dd9 (patch) | |
tree | 97192d5ad45ccd3fb216b9fb74562b26c81ce374 /apps | |
parent | c19466a2fac938a8be2c78d78abe19b4287b4e61 (diff) | |
download | rockbox-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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/radio.c | 19 |
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 */ | |||
127 | static int radio_mode = RADIO_SCAN_MODE; | 127 | static int radio_mode = RADIO_SCAN_MODE; |
128 | static int search_dir = 0; | 128 | static int search_dir = 0; |
129 | 129 | ||
130 | /* make sure that radio_stop() does a full run after rockbox boots */ | 130 | static int radio_status = FMRADIO_OFF; |
131 | static int radio_status = FMRADIO_PLAYING; | ||
132 | static bool in_screen = false; | 131 | static 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); | |||
148 | static int clear_preset_list(void); | 147 | static int clear_preset_list(void); |
149 | 148 | ||
150 | static int scan_presets(void *viewports); | 149 | static int scan_presets(void *viewports); |
150 | static 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) | |||
165 | void radio_init(void) | 165 | void radio_init(void) |
166 | { | 166 | { |
167 | tuner_init(); | 167 | tuner_init(); |
168 | radio_stop(); | 168 | radio_off(); |
169 | } | 169 | } |
170 | 170 | ||
171 | int get_radio_status(void) | 171 | int 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 | ||
259 | void radio_stop(void) | 259 | static 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 | |||
267 | void radio_stop(void) | ||
268 | { | ||
269 | if(radio_status == FMRADIO_OFF) | ||
270 | return; | ||
271 | |||
272 | radio_off(); | ||
268 | } /* radio_stop */ | 273 | } /* radio_stop */ |
269 | 274 | ||
270 | bool radio_hardware_present(void) | 275 | bool radio_hardware_present(void) |