summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-05 04:13:15 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-05 04:13:15 +0000
commit145135f99f9453af8593c8a9e1cae8556abde3de (patch)
treed44346988365ba9757108b8e8b72e5e6342557c1
parenta69e1c4a4425a69a920f7a85c45b1ac6de717a07 (diff)
downloadrockbox-145135f99f9453af8593c8a9e1cae8556abde3de.tar.gz
rockbox-145135f99f9453af8593c8a9e1cae8556abde3de.tar.bz2
rockbox-145135f99f9453af8593c8a9e1cae8556abde3de.zip
Fuzev2: don't disable interrupts in fm code, allow button tick to run
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25819 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/fmradio-i2c-as3525.c5
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c4
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 @@
#include "as3525.h"
#include "generic_i2c.h"
#include "fmradio_i2c.h"
-#include "system.h"
#if defined(SANSA_CLIP) || defined(SANSA_C200V2)
#define I2C_SCL_GPIO(x) GPIOB_PIN(x)
@@ -168,13 +167,11 @@ void fmradio_i2c_init(void)
int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
{
#ifdef SANSA_FUZEV2
- int s = disable_irq_save();
CCU_IO &= ~(1<<12);
#endif
int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count);
#ifdef SANSA_FUZEV2
CCU_IO |= 1<<12;
- restore_irq(s);
#endif
return ret;
}
@@ -182,13 +179,11 @@ int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count
int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count)
{
#ifdef SANSA_FUZEV2
- int s = disable_irq_save();
CCU_IO &= ~(1<<12);
#endif
int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count);
#ifdef SANSA_FUZEV2
CCU_IO |= 1<<12;
- restore_irq(s);
#endif
return ret;
}
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)
int delay = 30;
while(delay--) nop;
+ bool ccu_io_bit12 = CCU_IO & (1<<12);
CCU_IO &= ~(1<<12);
/* B1 is shared with FM i2c */
@@ -273,7 +274,8 @@ int button_read_device(void)
if(gpiob_pin0_dir)
GPIOB_DIR |= 1<<1;
- CCU_IO |= 1<<12;
+ if(ccu_io_bit12)
+ CCU_IO |= 1<<12;
#ifdef HAS_BUTTON_HOLD
#ifndef BOOTLOADER