From a95839f402f7d756a0db1935b8a4b30e5c823027 Mon Sep 17 00:00:00 2001 From: funman Date: Fri, 14 May 2010 22:01:40 +0000 Subject: [PATCH] =?utf8?q?fuzev2:=20prevent=20button=20light=20flickering?= =?utf8?q?=20when=20accessing=20=C2=B5SD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26031 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 887a84fb9..8df947275 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -45,6 +45,10 @@ #include "disk.h" #endif +#ifdef SANSA_FUZEV2 +#include "backlight-target.h" +#endif + #include "lcd.h" #include #include "sysfont.h" @@ -348,7 +352,6 @@ static volatile bool retry; static volatile int cmd_error; #if defined(HAVE_MULTIDRIVE) -int active_card = 0; #define EXT_SD_BITS (1<<2) #endif @@ -395,13 +398,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl unsigned long *response) { #if defined(HAVE_MULTIDRIVE) - /* Check to see if we need to switch cards */ if(sd_present(SD_SLOT_AS3525)) - if(active_card != drive) - { - GPIOB_PIN(5) = (1-drive) << 5; - active_card = drive; - } + GPIOB_PIN(5) = (1-drive) << 5; #endif /* RCRC & RTO interrupts should be set together with the CD interrupt but @@ -431,6 +429,13 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl /*b23 | CMD_CCS_EXPECTED unused */ /*b31 */ | CMD_DONE_BIT; +#ifdef SANSA_FUZEV2 + extern int buttonlight_is_on; + if(buttonlight_is_on) + _buttonlight_on(); + else + _buttonlight_off(); +#endif wakeup_wait(&command_completion_signal, TIMEOUT_BLOCK); MCI_MASK &= ~MCI_INT_CD; -- 2.11.4.GIT