diff options
Diffstat (limited to 'firmware/target/coldfire/mpio/hd200/backlight-hd200.c')
-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 | ||