mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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:
parent
0ad97d13fc
commit
e69d567d9e
37 changed files with 316 additions and 449 deletions
|
|
@ -138,8 +138,10 @@ void pcm_postinit(void)
|
|||
pcm_apply_settings();
|
||||
}
|
||||
|
||||
void pcm_set_frequency(unsigned int frequency)
|
||||
void pcm_dma_apply_settings(void)
|
||||
{
|
||||
unsigned long frequency = pcm_sampr;
|
||||
|
||||
const int divider = (((AS3525_PLLA_FREQ/128) + (frequency/2)) / frequency) - 1;
|
||||
if(divider < 0 || divider > 511)
|
||||
panicf("unsupported frequency %d", frequency);
|
||||
|
|
@ -147,13 +149,6 @@ void pcm_set_frequency(unsigned int frequency)
|
|||
CGU_AUDIO &= ~(((511 ^ divider) << 2) /* I2SOUT */
|
||||
/*| ((511 ^ divider) << 14) */ /* I2SIN */
|
||||
);
|
||||
|
||||
pcm_curr_sampr = frequency;
|
||||
}
|
||||
|
||||
void pcm_apply_settings(void)
|
||||
{
|
||||
pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue