diff options
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index ccdf7a44ea..442c441035 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -40,6 +40,7 @@ static int backlight_timeout = 5; | |||
40 | void backlight_thread(void) | 40 | void backlight_thread(void) |
41 | { | 41 | { |
42 | struct event ev; | 42 | struct event ev; |
43 | int tmp; | ||
43 | 44 | ||
44 | while(1) | 45 | while(1) |
45 | { | 46 | { |
@@ -51,7 +52,8 @@ void backlight_thread(void) | |||
51 | if(backlight_timer) | 52 | if(backlight_timer) |
52 | { | 53 | { |
53 | #ifdef HAVE_RTC | 54 | #ifdef HAVE_RTC |
54 | rtc_write(0x13, 0x10); | 55 | tmp = rtc_read(0x0a); |
56 | rtc_write(0x0a, tmp | 0x40); /* Enable square wave */ | ||
55 | #else | 57 | #else |
56 | PADR &= ~0x4000; | 58 | PADR &= ~0x4000; |
57 | #endif | 59 | #endif |
@@ -60,7 +62,8 @@ void backlight_thread(void) | |||
60 | 62 | ||
61 | case BACKLIGHT_OFF: | 63 | case BACKLIGHT_OFF: |
62 | #ifdef HAVE_RTC | 64 | #ifdef HAVE_RTC |
63 | rtc_write(0x13, 0x00); | 65 | tmp = rtc_read(0x0a); |
66 | rtc_write(0x0a, tmp & ~0x40); /* Disable square wave */ | ||
64 | #else | 67 | #else |
65 | PADR |= 0x4000; | 68 | PADR |= 0x4000; |
66 | #endif | 69 | #endif |
@@ -109,7 +112,8 @@ void backlight_tick(void) | |||
109 | void backlight_init(void) | 112 | void backlight_init(void) |
110 | { | 113 | { |
111 | #ifdef HAVE_RTC | 114 | #ifdef HAVE_RTC |
112 | rtc_write(0x0a, 0x40); /* Enable square wave */ | 115 | rtc_write(0x13, 0x10); /* 32 kHz swuare wave */ |
116 | rtc_write(0x01, 0x00); /* Clear Stop bit */ | ||
113 | #endif | 117 | #endif |
114 | queue_init(&backlight_queue); | 118 | queue_init(&backlight_queue); |
115 | create_thread(backlight_thread, backlight_stack, | 119 | create_thread(backlight_thread, backlight_stack, |