Do not touch FM tuner when it is turned off
Credit to Igor Poretsky
Change-Id: Ie9e61740f87f3b56d0b602cd431757262a6ed808
diff --git a/apps/radio/presets.c b/apps/radio/presets.c
index d9a2aa9..368cb71 100644
--- a/apps/radio/presets.c
+++ b/apps/radio/presets.c
@@ -516,7 +516,6 @@
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 49534ee..6055f64 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -333,7 +333,8 @@
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 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