diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-10-13 16:41:20 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-10-13 16:41:20 +0000 |
commit | 0290094d8a386acef6656e4c4b881d59edbb7079 (patch) | |
tree | 2886443f4f3c9a71cfb675769ccf03b866bebe02 /firmware | |
parent | 9680079496f86192dcce41794d989015798ef2a1 (diff) |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/as3525/pcm-as3525.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c index 4f9e18523d..20579806c0 100644 --- a/firmware/target/arm/as3525/pcm-as3525.c +++ b/firmware/target/arm/as3525/pcm-as3525.c @@ -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) |