m:robe 100 - enable setting for buttonlight brightness

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17134 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Kukla 2008-04-15 23:38:45 +00:00
parent 620e6b4d93
commit 4c86e34517
4 changed files with 18 additions and 19 deletions

View file

@ -3909,15 +3909,15 @@
user: user:
<source> <source>
*: none *: none
gigabeatf: "Button Light Brightness" gigabeatf,mrobe100: "Button Light Brightness"
</source> </source>
<dest> <dest>
*: none *: none
gigabeatf: "Button Light Brightness" gigabeatf,mrobe100: "Button Light Brightness"
</dest> </dest>
<voice> <voice>
*: none *: none
gigabeatf: "Button Light Brightness" gigabeatf,mrobe100: "Button Light Brightness"
</voice> </voice>
</phrase> </phrase>
<phrase> <phrase>

View file

@ -75,6 +75,8 @@
/* define this if you have a light associated with the buttons */ /* define this if you have a light associated with the buttons */
#define HAVE_BUTTON_LIGHT #define HAVE_BUTTON_LIGHT
#define HAVE_BUTTONLIGHT_BRIGHTNESS
#define BATTERY_CAPACITY_DEFAULT 720 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 720 /* default battery capacity */
#ifndef SIMULATOR #ifndef SIMULATOR

View file

@ -19,9 +19,10 @@
#include "backlight-target.h" #include "backlight-target.h"
#include "system.h" #include "system.h"
#include "lcd.h"
#include "backlight.h" #define MIN_BRIGHTNESS 0x80ff08ff
#include "i2c-pp.h"
static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255};
void _backlight_on(void) void _backlight_on(void)
{ {
@ -33,23 +34,18 @@ void _backlight_off(void)
GPO32_ENABLE &= ~0x1000000; GPO32_ENABLE &= ~0x1000000;
} }
void _buttonlight_set_brightness(int brightness)
{
/* clamp the brightness value */
brightness = MAX(0, MIN(15, brightness));
outl(MIN_BRIGHTNESS-(log_brightness[brightness - 1] << 16), 0x7000a010);
}
void _buttonlight_on(void) void _buttonlight_on(void)
{ {
/* turn on all touchpad leds */ /* turn on all touchpad leds */
GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL; GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL;
#if 0
/* Writing to 0x7000a010 controls the brightness of the leds.
This routine fades the leds from dim to bright, like when
you first turn the unit on. */
unsigned long val = 0x80ff08ff;
int i = 0;
for (i = 0; i < 16; i++)
outl(val, 0x7000a010);
udelay(100000);
val -= 0x110000;
}
#endif
} }
void _buttonlight_off(void) void _buttonlight_off(void)

View file

@ -35,6 +35,7 @@ void _backlight_off(void);
BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \ BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \
BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL) BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL)
void _buttonlight_set_brightness(int brightness);
void _buttonlight_on(void); void _buttonlight_on(void);
void _buttonlight_off(void); void _buttonlight_off(void);