diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/fmradio-i2c-as3525.c | 5 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/fmradio-i2c-as3525.c b/firmware/target/arm/as3525/fmradio-i2c-as3525.c index 31d701dc6d..33d12f9fa7 100644 --- a/firmware/target/arm/as3525/fmradio-i2c-as3525.c +++ b/firmware/target/arm/as3525/fmradio-i2c-as3525.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "as3525.h" | 30 | #include "as3525.h" |
31 | #include "generic_i2c.h" | 31 | #include "generic_i2c.h" |
32 | #include "fmradio_i2c.h" | 32 | #include "fmradio_i2c.h" |
33 | #include "system.h" | ||
34 | 33 | ||
35 | #if defined(SANSA_CLIP) || defined(SANSA_C200V2) | 34 | #if defined(SANSA_CLIP) || defined(SANSA_C200V2) |
36 | #define I2C_SCL_GPIO(x) GPIOB_PIN(x) | 35 | #define I2C_SCL_GPIO(x) GPIOB_PIN(x) |
@@ -168,13 +167,11 @@ void fmradio_i2c_init(void) | |||
168 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) | 167 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) |
169 | { | 168 | { |
170 | #ifdef SANSA_FUZEV2 | 169 | #ifdef SANSA_FUZEV2 |
171 | int s = disable_irq_save(); | ||
172 | CCU_IO &= ~(1<<12); | 170 | CCU_IO &= ~(1<<12); |
173 | #endif | 171 | #endif |
174 | int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count); | 172 | int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count); |
175 | #ifdef SANSA_FUZEV2 | 173 | #ifdef SANSA_FUZEV2 |
176 | CCU_IO |= 1<<12; | 174 | CCU_IO |= 1<<12; |
177 | restore_irq(s); | ||
178 | #endif | 175 | #endif |
179 | return ret; | 176 | return ret; |
180 | } | 177 | } |
@@ -182,13 +179,11 @@ int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count | |||
182 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) | 179 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) |
183 | { | 180 | { |
184 | #ifdef SANSA_FUZEV2 | 181 | #ifdef SANSA_FUZEV2 |
185 | int s = disable_irq_save(); | ||
186 | CCU_IO &= ~(1<<12); | 182 | CCU_IO &= ~(1<<12); |
187 | #endif | 183 | #endif |
188 | int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count); | 184 | int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count); |
189 | #ifdef SANSA_FUZEV2 | 185 | #ifdef SANSA_FUZEV2 |
190 | CCU_IO |= 1<<12; | 186 | CCU_IO |= 1<<12; |
191 | restore_irq(s); | ||
192 | #endif | 187 | #endif |
193 | return ret; | 188 | return ret; |
194 | } | 189 | } |
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c index fcda5226ca..4486af95b1 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | |||
@@ -230,6 +230,7 @@ int button_read_device(void) | |||
230 | int delay = 30; | 230 | int delay = 30; |
231 | while(delay--) nop; | 231 | while(delay--) nop; |
232 | 232 | ||
233 | bool ccu_io_bit12 = CCU_IO & (1<<12); | ||
233 | CCU_IO &= ~(1<<12); | 234 | CCU_IO &= ~(1<<12); |
234 | 235 | ||
235 | /* B1 is shared with FM i2c */ | 236 | /* B1 is shared with FM i2c */ |
@@ -273,7 +274,8 @@ int button_read_device(void) | |||
273 | if(gpiob_pin0_dir) | 274 | if(gpiob_pin0_dir) |
274 | GPIOB_DIR |= 1<<1; | 275 | GPIOB_DIR |= 1<<1; |
275 | 276 | ||
276 | CCU_IO |= 1<<12; | 277 | if(ccu_io_bit12) |
278 | CCU_IO |= 1<<12; | ||
277 | 279 | ||
278 | #ifdef HAS_BUTTON_HOLD | 280 | #ifdef HAS_BUTTON_HOLD |
279 | #ifndef BOOTLOADER | 281 | #ifndef BOOTLOADER |