1
0
Fork 0
forked from len0rd/rockbox

buttonlight for new fuzev2

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27501 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-07-20 05:55:32 +00:00
parent c6b838695c
commit ed616c604a

View file

@ -38,6 +38,10 @@ bool _backlight_init(void)
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80); ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x80);
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
/* needed for button light */
if (fuzev2_variant == 1)
ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
return true; return true;
} }
@ -65,6 +69,10 @@ void _buttonlight_on(void)
GPIOB_PIN(5) = (1<<5); GPIOB_PIN(5) = (1<<5);
buttonlight_is_on = 1; buttonlight_is_on = 1;
} }
else
{
ascodec_write_pmu(0x1a, 6, 0x80); /* PWM inverted */
}
} }
void _buttonlight_off(void) void _buttonlight_off(void)
@ -75,4 +83,8 @@ void _buttonlight_off(void)
GPIOB_DIR &= ~(1<<5); GPIOB_DIR &= ~(1<<5);
buttonlight_is_on = 0; buttonlight_is_on = 0;
} }
else
{
ascodec_write_pmu(0x1a, 6, 0); /* PWM not inverted */
}
} }