summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorHristo Kovachev <bger@rockbox.org>2006-03-07 11:49:06 +0000
committerHristo Kovachev <bger@rockbox.org>2006-03-07 11:49:06 +0000
commit3de0db0c3b0c2010ffb5c5884e8ec5ec260091d6 (patch)
tree9a6cd1def7cb396dce5bfbc193871a84b0aa8166 /apps
parentf52dfb9ffd7a2f2c9a370b80a7ce4a49b27240dd (diff)
downloadrockbox-3de0db0c3b0c2010ffb5c5884e8ec5ec260091d6.zip
rockbox-3de0db0c3b0c2010ffb5c5884e8ec5ec260091d6.tar.gz
rockbox-3de0db0c3b0c2010ffb5c5884e8ec5ec260091d6.tar.bz2
rockbox-3de0db0c3b0c2010ffb5c5884e8ec5ec260091d6.tar.xz
Patch FS#4745 by Manuel Dejonghe 1) Get CPU out of idle mode on key press (on targets, supporting changing of the CPU freq), thus making the radio screen more responsive; 2) Mute the radio on startup or after pause, until the chip is tuned or a timeout expires (1, resp 2 sec)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8944 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/radio.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 7b533e9..3a21826 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -304,6 +304,8 @@ bool radio_screen(void)
#endif
bool keep_playing = false;
bool statusbar = global_settings.statusbar;
+ int mute_timeout = current_tick;
+ int button_timeout = current_tick + (2*HZ);
#ifdef HAS_BUTTONBAR
struct gui_buttonbar buttonbar;
gui_buttonbar_init(&buttonbar);
@@ -378,6 +380,14 @@ bool radio_screen(void)
radio_set(RADIO_IF_MEASUREMENT, 0);
radio_set(RADIO_SENSITIVITY, 0);
radio_set(RADIO_FORCE_MONO, global_settings.fm_force_mono);
+ mute_timeout = current_tick + (1*HZ);
+ while( !radio_get(RADIO_STEREO)
+ &&!radio_get(RADIO_TUNED) )
+ {
+ if(TIME_AFTER(current_tick, mute_timeout))
+ break;
+ yield();
+ }
radio_set(RADIO_MUTE, 0);
radio_status = FMRADIO_PLAYING;
}
@@ -429,6 +439,11 @@ bool radio_screen(void)
button = button_get(false);
else
button = button_get_w_tmo(HZ / PEAK_METER_FPS);
+ if (button != BUTTON_NONE)
+ {
+ cpu_idle_mode(false);
+ button_timeout = current_tick + (2*HZ);
+ }
switch(button)
{
#ifdef FM_RC_STOP
@@ -603,6 +618,14 @@ bool radio_screen(void)
{
radio_set(RADIO_SLEEP, 0);
radio_set(RADIO_FREQUENCY, curr_freq);
+ mute_timeout = current_tick + (2*HZ);
+ while( !radio_get(RADIO_STEREO)
+ &&!radio_get(RADIO_TUNED) )
+ {
+ if(TIME_AFTER(current_tick, mute_timeout))
+ break;
+ yield();
+ }
radio_set(RADIO_MUTE, 0);
radio_status = FMRADIO_PLAYING;
}
@@ -731,7 +754,7 @@ bool radio_screen(void)
default:
default_event_handler(button);
break;
- }
+ } /*switch(button)*/
if (button != BUTTON_NONE)
lastbutton = button;
@@ -842,7 +865,11 @@ bool radio_screen(void)
{
done = true;
}
- }
+ if (TIME_AFTER(current_tick, button_timeout))
+ {
+ cpu_idle_mode(true);
+ }
+ } /*while(!done)*/
#ifndef SIMULATOR
if(audio_status() & AUDIO_STATUS_ERROR)