Bring consistency to pcm implementation and samplerate handling. Less low-level duplication. A small test_sampr fix so it works on coldfire again.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19400 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-12-12 11:01:07 +00:00
parent 0ad97d13fc
commit e69d567d9e
37 changed files with 316 additions and 449 deletions

View file

@ -28,6 +28,8 @@
#include "audiohw.h"
#include "dsp-target.h"
static int pcm_fsel = HW_FREQ_DEFAULT;
void pcm_play_dma_init(void)
{
IO_CLK_O1DIV = 3;
@ -37,7 +39,7 @@ void pcm_play_dma_init(void)
audiohw_init();
audiohw_set_frequency(1);
audiohw_set_frequency(HW_FREQ_DEFAULT);
/* init DSP */
dsp_init();
@ -46,42 +48,21 @@ void pcm_play_dma_init(void)
void pcm_postinit(void)
{
audiohw_postinit();
pcm_apply_settings();
/* wake DSP */
dsp_wake();
}
/* set frequency used by the audio hardware */
void pcm_set_frequency(unsigned int frequency)
{
int index;
switch(frequency)
{
case SAMPR_11:
case SAMPR_22:
index = 0;
break;
default:
case SAMPR_44:
index = 1;
break;
case SAMPR_88:
index = 2;
break;
}
audiohw_set_frequency(index);
} /* pcm_set_frequency */
const void * pcm_play_dma_get_peak_buffer(int *count)
{
(void) count;
return 0;
}
void pcm_apply_settings(void)
void pcm_dma_apply_settings(void)
{
audiohw_set_frequency(pcm_fsel);
}
void pcm_play_dma_start(const void *addr, size_t size)