diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-07-19 15:56:15 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-07-19 15:56:15 +0000 |
commit | b221d6d4d4d0ade805d249fdd69a8b8b92769268 (patch) | |
tree | 4bf2466a312b51afda062ac1a8c6bbe93619321b /firmware/target/arm/as3525/fmradio-i2c-as3525.c | |
parent | 25491980d6615098bab331fde65006f7c66eadf3 (diff) | |
download | rockbox-b221d6d4d4d0ade805d249fdd69a8b8b92769268.tar.gz rockbox-b221d6d4d4d0ade805d249fdd69a8b8b92769268.zip |
as3525*: use atomic bit manipulation for CCU_IO
fuzev2 button_read_device() runs in interrupt context so writes are atomic
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27494 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/fmradio-i2c-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/fmradio-i2c-as3525.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/fmradio-i2c-as3525.c b/firmware/target/arm/as3525/fmradio-i2c-as3525.c index 9e8dc63144..70287c38b8 100644 --- a/firmware/target/arm/as3525/fmradio-i2c-as3525.c +++ b/firmware/target/arm/as3525/fmradio-i2c-as3525.c | |||
@@ -158,11 +158,11 @@ void fmradio_i2c_init(void) | |||
158 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) | 158 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) |
159 | { | 159 | { |
160 | #ifdef SANSA_FUZEV2 | 160 | #ifdef SANSA_FUZEV2 |
161 | CCU_IO &= ~(1<<12); | 161 | bitclr32(&CCU_IO, 1<<12); |
162 | #endif | 162 | #endif |
163 | int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count); | 163 | int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count); |
164 | #ifdef SANSA_FUZEV2 | 164 | #ifdef SANSA_FUZEV2 |
165 | CCU_IO |= 1<<12; | 165 | bitset32(&CCU_IO, 1<<12); |
166 | #endif | 166 | #endif |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
@@ -170,11 +170,11 @@ int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count | |||
170 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) | 170 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) |
171 | { | 171 | { |
172 | #ifdef SANSA_FUZEV2 | 172 | #ifdef SANSA_FUZEV2 |
173 | CCU_IO &= ~(1<<12); | 173 | bitclr32(&CCU_IO, 1<<12); |
174 | #endif | 174 | #endif |
175 | int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count); | 175 | int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count); |
176 | #ifdef SANSA_FUZEV2 | 176 | #ifdef SANSA_FUZEV2 |
177 | CCU_IO |= 1<<12; | 177 | bitset32(&CCU_IO, 1<<12); |
178 | #endif | 178 | #endif |
179 | return ret; | 179 | return ret; |
180 | } | 180 | } |