mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Sansa AMS PCM : replace buggy and confusing one-liner
The bits which are not divider (i2si/i2so enable and clock selection) would be unset. This is not a problem in the current code since this function was always called before starting playback (and setting those bits) but this might be a problem when recording is enabled. Finally it is simpler to read. Thanks to Fred Bauer for pointing this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23156 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9680079496
commit
0290094d8a
1 changed files with 8 additions and 3 deletions
|
|
@ -150,9 +150,14 @@ void pcm_dma_apply_settings(void)
|
|||
if(divider < 0 || divider > 511)
|
||||
panicf("unsupported frequency %ld", frequency);
|
||||
|
||||
CGU_AUDIO &= ~(((511 ^ divider) << 2) /* I2SOUT */
|
||||
/*| ((511 ^ divider) << 14) */ /* I2SIN */
|
||||
);
|
||||
int cgu_audio = CGU_AUDIO; /* read register */
|
||||
cgu_audio &= ~(511 << 2); /* clear i2sout divider */
|
||||
cgu_audio |= divider << 2; /* set new i2sout divider */
|
||||
#if 0
|
||||
cgu_audio &= ~(511 << 14); /* clear i2sin divider */
|
||||
cgu_audio |= divider << 14; /* set new i2sin divider */
|
||||
#endif
|
||||
CGU_AUDIO = cgu_audio; /* write back register */
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue