From b221d6d4d4d0ade805d249fdd69a8b8b92769268 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 19 Jul 2010 15:56:15 +0000 Subject: 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 --- firmware/target/arm/as3525/sd-as3525.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/target/arm/as3525/sd-as3525.c') diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 6e5845cf0a..35cb997629 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -564,8 +564,8 @@ int sd_init(void) bitset32(&CGU_PERI, CGU_NAF_CLOCK_ENABLE); #ifdef HAVE_MULTIDRIVE bitset32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE); - CCU_IO &= ~(1<<3); /* bits 3:2 = 01, xpd is SD interface */ - CCU_IO |= (1<<2); + bitclr32(&CCU_IO, 1<<3); /* bits 3:2 = 01, xpd is SD interface */ + bitset32(&CCU_IO, 1<<2); #endif wakeup_init(&transfer_completion_signal); @@ -968,7 +968,7 @@ void sd_enable(bool on) #if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) /* buttonlight AMSes need a bit of special handling for the buttonlight * here due to the dual mapping of GPIOD and XPD */ - CCU_IO |= (1<<2); /* XPD is SD-MCI interface (b3:2 = 01) */ + bitset32(&CCU_IO, 1<<2); /* XPD is SD-MCI interface (b3:2 = 01) */ if (buttonlight_is_on) GPIOD_DIR &= ~(1<<7); else @@ -994,7 +994,7 @@ void sd_enable(bool on) #endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */ #if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) - CCU_IO &= ~(1<<2); /* XPD is general purpose IO (b3:2 = 00) */ + bitclr32(&CCU_IO, 1<<2); /* XPD is general purpose IO (b3:2 = 00) */ if (buttonlight_is_on) _buttonlight_on(); #endif -- cgit v1.2.3