From 79cfc221a5f9a46f220875e5222e3143479f1c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Sat, 15 May 2010 16:21:47 +0000 Subject: [PATCH] =?UTF-8?q?fuzev2:=20fix=20buttonlight=20flashing=20on=20?= =?UTF-8?q?=C2=B5SD=20access=20(2nd=20try)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it would still flash when the light was off it turns out that if B5 is set to input the light can't be turned on but we can still select between µSD slot and internal storage git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26059 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c | 5 ++--- firmware/target/arm/as3525/sd-as3525v2.c | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c index 1bc16babdd..29e145053c 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c @@ -35,9 +35,6 @@ void _backlight_set_brightness(int brightness) bool _backlight_init(void) { - GPIOB_DIR |= 1<<5; /* for buttonlight, stuff below seems to be needed - for buttonlight as well*/ - ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80); ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); @@ -62,6 +59,7 @@ void _backlight_off(void) void _buttonlight_on(void) { + GPIOB_DIR |= 1<<5; GPIOB_PIN(5) = (1<<5); buttonlight_is_on = 1; } @@ -69,5 +67,6 @@ void _buttonlight_on(void) void _buttonlight_off(void) { GPIOB_PIN(5) = 0; + GPIOB_DIR &= ~(1<<5); buttonlight_is_on = 0; } diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 94ba019183..37d72217b3 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -700,8 +700,6 @@ static void init_controller(void) /* Rx watermark = 63(sd reads) Tx watermark = 128 (sd writes) */ MCI_FIFOTH = (MCI_FIFOTH & MCI_FIFOTH_MASK) | 0x503f0080; - GPIOB_DIR |= (1<<5); /* Set pin B5 to output */ - /* Mask all MCI Interrupts initially */ MCI_MASK = 0;