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
This commit is contained in:
Miika Pekkarinen 2005-08-28 19:55:30 +00:00
parent d7170b7542
commit 65d43a2d22
3 changed files with 22 additions and 15 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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)