From 8e682ca380fbb7e73380dd789c81dedfd489aa95 Mon Sep 17 00:00:00 2001 From: gevaerts Date: Wed, 31 Mar 2010 19:59:50 +0000 Subject: [PATCH] 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 --- apps/recorder/radio.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index e6e51d976..0523f1eca 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -127,8 +127,7 @@ static int curr_freq; /* current frequency in Hz */ static int radio_mode = RADIO_SCAN_MODE; static int search_dir = 0; -/* make sure that radio_stop() does a full run after rockbox boots */ -static int radio_status = FMRADIO_PLAYING; +static int radio_status = FMRADIO_OFF; static bool in_screen = false; #define MAX_PRESETS 64 @@ -148,6 +147,7 @@ static int load_preset_list(void); static int clear_preset_list(void); static int scan_presets(void *viewports); +static void radio_off(void); /* Function to manipulate all yesno dialogues. This function needs the output text as an argument. */ @@ -165,7 +165,7 @@ static bool yesno_pop(const char* text) void radio_init(void) { tuner_init(); - radio_stop(); + radio_off(); } int get_radio_status(void) @@ -256,15 +256,20 @@ void radio_pause(void) radio_status = FMRADIO_PAUSED; } /* radio_pause */ -void radio_stop(void) +static void radio_off(void) { - if(radio_status == FMRADIO_OFF) - return; - tuner_set(RADIO_MUTE, 1); tuner_set(RADIO_SLEEP, 1); /* low power mode, if available */ radio_status = FMRADIO_OFF; tuner_power(false); /* status update, power off if avail. */ +} + +void radio_stop(void) +{ + if(radio_status == FMRADIO_OFF) + return; + + radio_off(); } /* radio_stop */ bool radio_hardware_present(void) -- 2.11.4.GIT