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:
Rafaël Carré 2009-10-13 16:41:20 +00:00
parent 9680079496
commit 0290094d8a

View file

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