diff options
-rw-r--r-- | apps/lang/english.lang | 6 | ||||
-rw-r--r-- | firmware/export/config-mrobe100.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | 28 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-target.h | 1 |
4 files changed, 18 insertions, 19 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index bd9e09c50b..f43df0dbad 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -3909,15 +3909,15 @@ | |||
3909 | user: | 3909 | user: |
3910 | <source> | 3910 | <source> |
3911 | *: none | 3911 | *: none |
3912 | gigabeatf: "Button Light Brightness" | 3912 | gigabeatf,mrobe100: "Button Light Brightness" |
3913 | </source> | 3913 | </source> |
3914 | <dest> | 3914 | <dest> |
3915 | *: none | 3915 | *: none |
3916 | gigabeatf: "Button Light Brightness" | 3916 | gigabeatf,mrobe100: "Button Light Brightness" |
3917 | </dest> | 3917 | </dest> |
3918 | <voice> | 3918 | <voice> |
3919 | *: none | 3919 | *: none |
3920 | gigabeatf: "Button Light Brightness" | 3920 | gigabeatf,mrobe100: "Button Light Brightness" |
3921 | </voice> | 3921 | </voice> |
3922 | </phrase> | 3922 | </phrase> |
3923 | <phrase> | 3923 | <phrase> |
diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index 19964998c5..0365bb381f 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h | |||
@@ -75,6 +75,8 @@ | |||
75 | /* define this if you have a light associated with the buttons */ | 75 | /* define this if you have a light associated with the buttons */ |
76 | #define HAVE_BUTTON_LIGHT | 76 | #define HAVE_BUTTON_LIGHT |
77 | 77 | ||
78 | #define HAVE_BUTTONLIGHT_BRIGHTNESS | ||
79 | |||
78 | #define BATTERY_CAPACITY_DEFAULT 720 /* default battery capacity */ | 80 | #define BATTERY_CAPACITY_DEFAULT 720 /* default battery capacity */ |
79 | 81 | ||
80 | #ifndef SIMULATOR | 82 | #ifndef SIMULATOR |
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c index 24a62d232f..f5a7370590 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | |||
@@ -19,9 +19,10 @@ | |||
19 | 19 | ||
20 | #include "backlight-target.h" | 20 | #include "backlight-target.h" |
21 | #include "system.h" | 21 | #include "system.h" |
22 | #include "lcd.h" | 22 | |
23 | #include "backlight.h" | 23 | #define MIN_BRIGHTNESS 0x80ff08ff |
24 | #include "i2c-pp.h" | 24 | |
25 | static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255}; | ||
25 | 26 | ||
26 | void _backlight_on(void) | 27 | void _backlight_on(void) |
27 | { | 28 | { |
@@ -33,23 +34,18 @@ void _backlight_off(void) | |||
33 | GPO32_ENABLE &= ~0x1000000; | 34 | GPO32_ENABLE &= ~0x1000000; |
34 | } | 35 | } |
35 | 36 | ||
37 | void _buttonlight_set_brightness(int brightness) | ||
38 | { | ||
39 | /* clamp the brightness value */ | ||
40 | brightness = MAX(0, MIN(15, brightness)); | ||
41 | |||
42 | outl(MIN_BRIGHTNESS-(log_brightness[brightness - 1] << 16), 0x7000a010); | ||
43 | } | ||
44 | |||
36 | void _buttonlight_on(void) | 45 | void _buttonlight_on(void) |
37 | { | 46 | { |
38 | /* turn on all touchpad leds */ | 47 | /* turn on all touchpad leds */ |
39 | GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL; | 48 | GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL; |
40 | |||
41 | #if 0 | ||
42 | /* Writing to 0x7000a010 controls the brightness of the leds. | ||
43 | This routine fades the leds from dim to bright, like when | ||
44 | you first turn the unit on. */ | ||
45 | unsigned long val = 0x80ff08ff; | ||
46 | int i = 0; | ||
47 | for (i = 0; i < 16; i++) | ||
48 | outl(val, 0x7000a010); | ||
49 | udelay(100000); | ||
50 | val -= 0x110000; | ||
51 | } | ||
52 | #endif | ||
53 | } | 49 | } |
54 | 50 | ||
55 | void _buttonlight_off(void) | 51 | void _buttonlight_off(void) |
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-target.h b/firmware/target/arm/olympus/mrobe-100/backlight-target.h index e6c8387222..7b4787fec3 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-target.h +++ b/firmware/target/arm/olympus/mrobe-100/backlight-target.h | |||
@@ -35,6 +35,7 @@ void _backlight_off(void); | |||
35 | BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \ | 35 | BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \ |
36 | BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL) | 36 | BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL) |
37 | 37 | ||
38 | void _buttonlight_set_brightness(int brightness); | ||
38 | void _buttonlight_on(void); | 39 | void _buttonlight_on(void); |
39 | void _buttonlight_off(void); | 40 | void _buttonlight_off(void); |
40 | 41 | ||