From 65d43a2d223f39f5f4f6d7394052aecd6263a9e0 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 28 Aug 2005 19:55:30 +0000 Subject: [PATCH] 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 --- apps/pcmbuf.c | 23 +++++++++++------------ apps/pcmbuf.h | 5 +++++ apps/playback.c | 9 ++++++--- 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)