diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2018-12-22 22:07:19 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2018-12-24 00:01:02 +0100 |
commit | 7a718fc27dfea78bb212b4fd492334f4f142594e (patch) | |
tree | f53f3c16a2815f65aca00408cab67f27b6fc27eb | |
parent | d636c5e8233c7f0a71a38f9e92546675e171b282 (diff) | |
download | rockbox-7a718fc27dfea78bb212b4fd492334f4f142594e.tar.gz rockbox-7a718fc27dfea78bb212b4fd492334f4f142594e.zip |
Do not touch FM tuner when it is turned off
Credit to Igor Poretsky
Change-Id: Ie9e61740f87f3b56d0b602cd431757262a6ed808
-rw-r--r-- | apps/radio/presets.c | 1 | ||||
-rw-r--r-- | apps/radio/radio.c | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/radio/presets.c b/apps/radio/presets.c index d9a2aa9bcd..368cb71e14 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c | |||
@@ -516,7 +516,6 @@ int handle_radio_presets(void) | |||
516 | curr_preset = gui_synclist_get_sel_pos(&lists); | 516 | curr_preset = gui_synclist_get_sel_pos(&lists); |
517 | curr_freq = presets[curr_preset].frequency; | 517 | curr_freq = presets[curr_preset].frequency; |
518 | next_station(0); | 518 | next_station(0); |
519 | remember_frequency(); | ||
520 | result = 1; | 519 | result = 1; |
521 | break; | 520 | break; |
522 | case ACTION_F3: | 521 | case ACTION_F3: |
diff --git a/apps/radio/radio.c b/apps/radio/radio.c index 49534ee3dc..6055f645eb 100644 --- a/apps/radio/radio.c +++ b/apps/radio/radio.c | |||
@@ -333,7 +333,8 @@ void next_station(int direction) | |||
333 | if (radio_status == FMRADIO_PLAYING) | 333 | if (radio_status == FMRADIO_PLAYING) |
334 | tuner_set(RADIO_MUTE, 1); | 334 | tuner_set(RADIO_MUTE, 1); |
335 | 335 | ||
336 | tuner_set(RADIO_FREQUENCY, curr_freq); | 336 | if(radio_status != FMRADIO_OFF) |
337 | tuner_set(RADIO_FREQUENCY, curr_freq); | ||
337 | 338 | ||
338 | if (radio_status == FMRADIO_PLAYING) | 339 | if (radio_status == FMRADIO_PLAYING) |
339 | tuner_set(RADIO_MUTE, 0); | 340 | tuner_set(RADIO_MUTE, 0); |
@@ -853,17 +854,19 @@ void radio_screen(void) | |||
853 | 854 | ||
854 | void toggle_mono_mode(bool mono) | 855 | void toggle_mono_mode(bool mono) |
855 | { | 856 | { |
856 | tuner_set(RADIO_FORCE_MONO, mono); | 857 | if(radio_status != FMRADIO_OFF) |
858 | tuner_set(RADIO_FORCE_MONO, mono); | ||
857 | } | 859 | } |
858 | 860 | ||
859 | void set_radio_region(int region) | 861 | void set_radio_region(int region) |
860 | { | 862 | { |
861 | #ifdef HAVE_RADIO_REGION | 863 | #ifdef HAVE_RADIO_REGION |
862 | tuner_set(RADIO_REGION, region); | 864 | if(radio_status != FMRADIO_OFF) |
865 | tuner_set(RADIO_REGION, region); | ||
866 | #else | ||
867 | (void)region; | ||
863 | #endif | 868 | #endif |
864 | next_station(0); | 869 | next_station(0); |
865 | remember_frequency(); | ||
866 | (void)region; | ||
867 | } | 870 | } |
868 | 871 | ||
869 | #endif | 872 | #endif |