From eab630a1e1463be244118613537f6a04d290f5e0 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Fri, 1 Apr 2011 21:29:08 +0000 Subject: AMSv2: fix dependency between button light and sd card control for fuze v2 variant 0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29667 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c') diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c index 617f7095f4..68c626d829 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c @@ -26,8 +26,6 @@ #include "ascodec-target.h" #include "as3514.h" -int buttonlight_is_on = 0; - void _backlight_set_brightness(int brightness) { ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10); @@ -39,8 +37,14 @@ bool _backlight_init(void) ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); /* needed for button light */ - if (amsv2_variant == 1) + if (amsv2_variant == 0) + { + GPIOB_DIR |= 1<<5; + } + else + { ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */ + } return true; } @@ -65,9 +69,7 @@ void _buttonlight_on(void) { if (amsv2_variant == 0) { - GPIOB_DIR |= 1<<5; GPIOB_PIN(5) = (1<<5); - buttonlight_is_on = 1; } else { @@ -80,8 +82,6 @@ void _buttonlight_off(void) if (amsv2_variant == 0) { GPIOB_PIN(5) = 0; - GPIOB_DIR &= ~(1<<5); - buttonlight_is_on = 0; } else { -- cgit v1.2.3