diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-30 13:59:00 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-30 13:59:00 +0000 |
commit | 572ac53359776eb962bd8c76c2d451fcd1f515f6 (patch) | |
tree | 35ef4419a4a4b9f8f512f352b0480bd016fe677c | |
parent | 2a50270e44ae03e4e5e7fee72f1f7f6db54be54b (diff) | |
download | rockbox-572ac53359776eb962bd8c76c2d451fcd1f515f6.tar.gz rockbox-572ac53359776eb962bd8c76c2d451fcd1f515f6.zip |
HD200 - small fix in backlight code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25766 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/backlight-hd200.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/backlight-hd200.c b/firmware/target/coldfire/mpio/hd200/backlight-hd200.c index 783376c91e..ef698b2a4a 100644 --- a/firmware/target/coldfire/mpio/hd200/backlight-hd200.c +++ b/firmware/target/coldfire/mpio/hd200/backlight-hd200.c | |||
@@ -27,13 +27,15 @@ | |||
27 | #include "backlight-target.h" | 27 | #include "backlight-target.h" |
28 | #include "lcd.h" | 28 | #include "lcd.h" |
29 | 29 | ||
30 | static bool _backlight_on = false; | 30 | static bool _backlight_on = true; |
31 | static int _brightness = DEFAULT_BRIGHTNESS_SETTING; | 31 | static int _brightness = DEFAULT_BRIGHTNESS_SETTING; |
32 | 32 | ||
33 | /* Returns the current state of the backlight (true=ON, false=OFF). */ | 33 | /* Returns the current state of the backlight (true=ON, false=OFF). */ |
34 | bool _backlight_init(void) | 34 | bool _backlight_init(void) |
35 | { | 35 | { |
36 | #ifdef BOOTLOADER | ||
36 | and_l(~(1<<28),&GPIO_OUT); | 37 | and_l(~(1<<28),&GPIO_OUT); |
38 | #endif | ||
37 | or_l((1<<28),&GPIO_FUNCTION); | 39 | or_l((1<<28),&GPIO_FUNCTION); |
38 | or_l((1<<28),&GPIO_ENABLE); | 40 | or_l((1<<28),&GPIO_ENABLE); |
39 | return true; | 41 | return true; |
@@ -61,6 +63,9 @@ void _backlight_set_brightness(int val) | |||
61 | { | 63 | { |
62 | unsigned char i; | 64 | unsigned char i; |
63 | 65 | ||
66 | if( _brightness == val && _backlight_on == true ) | ||
67 | return; | ||
68 | |||
64 | and_l(~(1<<28),&GPIO_OUT); | 69 | and_l(~(1<<28),&GPIO_OUT); |
65 | sleep(4); | 70 | sleep(4); |
66 | 71 | ||