summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-08-28 19:55:30 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-08-28 19:55:30 +0000
commit65d43a2d223f39f5f4f6d7394052aecd6263a9e0 (patch)
treee046b4249cccda737f4665697d2f05e6c113cbd8 /apps
parentd7170b7542f9a593377f2f36e3d1f933681af718 (diff)
downloadrockbox-65d43a2d223f39f5f4f6d7394052aecd6263a9e0.tar.gz
rockbox-65d43a2d223f39f5f4f6d7394052aecd6263a9e0.tar.bz2
rockbox-65d43a2d223f39f5f4f6d7394052aecd6263a9e0.zip
Define empty macros for cpu boosting on targets with no such a feature.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7412 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/pcmbuf.c23
-rw-r--r--apps/pcmbuf.h5
-rw-r--r--apps/playback.c9
3 files changed, 22 insertions, 15 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index bf5269a32e..1bcfb25f5e 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -61,9 +61,6 @@ static int crossfade_pos;
static int crossfade_amount;
static int crossfade_rem;
-
-static bool boost_mode;
-
/* Crossfade modes. If CFM_CROSSFADE is selected, normal
* crossfader will activate. Selecting CFM_FLUSH is a special
* operation that only overwrites the pcm buffer without crossfading.
@@ -93,6 +90,9 @@ void (*pcmbuf_watermark_event)(int bytes_left);
static int last_chunksize;
static long mixpos = 0;
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+static bool boost_mode;
+
void pcmbuf_boost(bool state)
{
static bool boost_state = false;
@@ -101,13 +101,19 @@ void pcmbuf_boost(bool state)
return ;
if (state != boost_state) {
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
cpu_boost(state);
-#endif
boost_state = state;
}
}
+void pcmbuf_set_boost_mode(bool state)
+{
+ if (state)
+ pcmbuf_boost(true);
+ boost_mode = state;
+}
+#endif
+
int pcmbuf_num_used_buffers(void)
{
return (pcmbuf_write_index - pcmbuf_read_index) & NUM_PCM_BUFFERS_MASK;
@@ -191,13 +197,6 @@ void pcmbuf_watermark_callback(int bytes_left)
crossfade_active = false;
}
-void pcmbuf_set_boost_mode(bool state)
-{
- if (state)
- pcmbuf_boost(true);
- boost_mode = state;
-}
-
void pcmbuf_add_event(void (*event_handler)(void))
{
pcmbuf_event_handler = event_handler;
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index cce7c4ec77..629f969e7d 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -33,8 +33,13 @@ bool pcmbuf_add_chunk(void *addr, int size, void (*callback)(void));
int pcmbuf_num_used_buffers(void);
void pcmbuf_set_watermark(int numbytes, void (*callback)(int bytes_left));
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
void pcmbuf_boost(bool state);
void pcmbuf_set_boost_mode(bool state);
+#else
+#define pcmbuf_boost(state) do { } while(0)
+#define pcmbuf_set_boost_mode(state) do { } while(0)
+#endif
bool pcmbuf_is_lowdata(void);
void pcmbuf_flush_audio(void);
void pcmbuf_play_start(void);
diff --git a/apps/playback.c b/apps/playback.c
index ffd298fbdf..c106644d9f 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -131,7 +131,6 @@ static struct mp3entry id3_voice;
static char *voicebuf;
static int voice_remaining;
static bool voice_is_playing;
-static bool voice_cpu_boosted = false;
static void (*voice_getmore)(unsigned char** start, int* size);
/* Is file buffer currently being refilled? */
@@ -255,16 +254,20 @@ static void swap_codec(void)
logf("codec resuming:%d", current_codec);
}
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
static void voice_boost_cpu(bool state)
{
+ static bool voice_cpu_boosted = false;
+
if (state != voice_cpu_boosted)
{
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
cpu_boost(state);
-#endif
voice_cpu_boosted = state;
}
}
+#else
+#define voice_boost_cpu(state) do { } while(0)
+#endif
bool codec_pcmbuf_insert_split_callback(void *ch1, void *ch2,
long length)