diff options
author | Robert Kukla <roolku@rockbox.org> | 2008-04-25 20:06:42 +0000 |
---|---|---|
committer | Robert Kukla <roolku@rockbox.org> | 2008-04-25 20:06:42 +0000 |
commit | b39f9bffde554713c8e5268bfcf72e4ace8839db (patch) | |
tree | 5afa345f64d7034f1d14a34ef9393a71824a6276 | |
parent | db7333971699eaa306b2fa9b519132da917bba68 (diff) | |
download | rockbox-b39f9bffde554713c8e5268bfcf72e4ace8839db.tar.gz rockbox-b39f9bffde554713c8e5268bfcf72e4ace8839db.zip |
m:robe 100 - backlight PWM fading
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17248 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/config-mrobe100.h | 6 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | 13 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-target.h | 17 |
3 files changed, 27 insertions, 9 deletions
diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index 0365bb381f..dd8b170f9e 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h | |||
@@ -4,8 +4,6 @@ | |||
4 | 4 | ||
5 | #define TARGET_TREE | 5 | #define TARGET_TREE |
6 | 6 | ||
7 | #define OLYMPUS_MROBE_100 1 | ||
8 | |||
9 | /* For Rolo and boot loader */ | 7 | /* For Rolo and boot loader */ |
10 | #define MODEL_NUMBER 23 | 8 | #define MODEL_NUMBER 23 |
11 | #define MODEL_NAME "Olympus m:robe MR-100" | 9 | #define MODEL_NAME "Olympus m:robe MR-100" |
@@ -65,7 +63,9 @@ | |||
65 | 63 | ||
66 | /* Define this for LCD backlight available */ | 64 | /* Define this for LCD backlight available */ |
67 | #define HAVE_BACKLIGHT | 65 | #define HAVE_BACKLIGHT |
68 | /* TODO #define HAVE_BACKLIGHT_BRIGHTNESS */ | 66 | |
67 | /* We can fade the backlight by using PWM */ | ||
68 | #define HAVE_BACKLIGHT_PWM_FADING | ||
69 | 69 | ||
70 | /* Main LCD backlight brightness range and defaults */ | 70 | /* Main LCD backlight brightness range and defaults */ |
71 | #define MIN_BRIGHTNESS_SETTING 1 | 71 | #define MIN_BRIGHTNESS_SETTING 1 |
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c index f5a7370590..07c97dfb58 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | |||
@@ -17,19 +17,26 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include "backlight-target.h" | 20 | #include "config.h" |
21 | #include "system.h" | 21 | #include "system.h" |
22 | #include "backlight-target.h" | ||
22 | 23 | ||
23 | #define MIN_BRIGHTNESS 0x80ff08ff | 24 | #define MIN_BRIGHTNESS 0x80ff08ff |
24 | 25 | ||
25 | static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255}; | 26 | static const int log_brightness[12] = {0,4,8,12,20,28,40,60,88,124,176,255}; |
26 | 27 | ||
27 | void _backlight_on(void) | 28 | /* Returns the current state of the backlight (true=ON, false=OFF). */ |
29 | bool _backlight_init(void) | ||
30 | { | ||
31 | return (GPO32_ENABLE & 0x1000000) ? true : false; | ||
32 | } | ||
33 | |||
34 | void _backlight_hw_on(void) | ||
28 | { | 35 | { |
29 | GPO32_ENABLE |= 0x1000000; | 36 | GPO32_ENABLE |= 0x1000000; |
30 | } | 37 | } |
31 | 38 | ||
32 | void _backlight_off(void) | 39 | void _backlight_hw_off(void) |
33 | { | 40 | { |
34 | GPO32_ENABLE &= ~0x1000000; | 41 | GPO32_ENABLE &= ~0x1000000; |
35 | } | 42 | } |
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-target.h b/firmware/target/arm/olympus/mrobe-100/backlight-target.h index 7b4787fec3..9aeac85541 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-target.h +++ b/firmware/target/arm/olympus/mrobe-100/backlight-target.h | |||
@@ -20,9 +20,20 @@ | |||
20 | #ifndef BACKLIGHT_TARGET_H | 20 | #ifndef BACKLIGHT_TARGET_H |
21 | #define BACKLIGHT_TARGET_H | 21 | #define BACKLIGHT_TARGET_H |
22 | 22 | ||
23 | #define _backlight_init() true | 23 | bool _backlight_init(void); /* Returns backlight current state (true=ON). */ |
24 | void _backlight_on(void); | 24 | void _backlight_hw_on(void); |
25 | void _backlight_off(void); | 25 | void _backlight_hw_off(void); |
26 | |||
27 | #ifdef BOOTLOADER | ||
28 | #define _backlight_on() _backlight_hw_on() | ||
29 | #define _backlight_off() _backlight_hw_off() | ||
30 | #else | ||
31 | #define _backlight_on_isr() _backlight_hw_on() | ||
32 | #define _backlight_off_isr() _backlight_hw_off() | ||
33 | #define _backlight_on_normal() _backlight_hw_on() | ||
34 | #define _backlight_off_normal() _backlight_hw_off() | ||
35 | #define _BACKLIGHT_FADE_BOOST | ||
36 | #endif | ||
26 | 37 | ||
27 | /* Button lights are controlled by GPIOA_OUTPUT_VAL */ | 38 | /* Button lights are controlled by GPIOA_OUTPUT_VAL */ |
28 | #define BUTTONLIGHT_PLAY 0x01 | 39 | #define BUTTONLIGHT_PLAY 0x01 |