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
This commit is contained in:
Rafaël Carré 2010-05-05 04:13:15 +00:00
parent a69e1c4a44
commit 145135f99f
2 changed files with 3 additions and 6 deletions

View file

@ -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;
}

View file

@ -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,6 +274,7 @@ int button_read_device(void)
if(gpiob_pin0_dir)
GPIOB_DIR |= 1<<1;
if(ccu_io_bit12)
CCU_IO |= 1<<12;
#ifdef HAS_BUTTON_HOLD