summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-12-22 22:07:19 -0500
committerSolomon Peachy <pizza@shaftnet.org>2018-12-24 00:01:02 +0100
commit7a718fc27dfea78bb212b4fd492334f4f142594e (patch)
treef53f3c16a2815f65aca00408cab67f27b6fc27eb
parentd636c5e8233c7f0a71a38f9e92546675e171b282 (diff)
Do not touch FM tuner when it is turned off
Credit to Igor Poretsky Change-Id: Ie9e61740f87f3b56d0b602cd431757262a6ed808
-rw-r--r--apps/radio/presets.c1
-rw-r--r--apps/radio/radio.c13
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)
curr_preset = gui_synclist_get_sel_pos(&lists);
curr_freq = presets[curr_preset].frequency;
next_station(0);
- remember_frequency();
result = 1;
break;
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)
if (radio_status == FMRADIO_PLAYING)
tuner_set(RADIO_MUTE, 1);
- tuner_set(RADIO_FREQUENCY, curr_freq);
+ if(radio_status != FMRADIO_OFF)
+ tuner_set(RADIO_FREQUENCY, curr_freq);
if (radio_status == FMRADIO_PLAYING)
tuner_set(RADIO_MUTE, 0);
@@ -853,17 +854,19 @@ void radio_screen(void)
void toggle_mono_mode(bool mono)
{
- tuner_set(RADIO_FORCE_MONO, mono);
+ if(radio_status != FMRADIO_OFF)
+ tuner_set(RADIO_FORCE_MONO, mono);
}
void set_radio_region(int region)
{
#ifdef HAVE_RADIO_REGION
- tuner_set(RADIO_REGION, region);
+ if(radio_status != FMRADIO_OFF)
+ tuner_set(RADIO_REGION, region);
+#else
+ (void)region;
#endif
next_station(0);
- remember_frequency();
- (void)region;
}
#endif