summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-25 22:04:03 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-25 22:04:03 +0000
commit1cf053982e16a4d1e42e9e129265feef8f2b787c (patch)
treeffbe11a44e976c79bace5fc09b423745dad017a0
parentd731cdd0db2e5e0ba2272f89df47f44348943500 (diff)
downloadrockbox-1cf053982e16a4d1e42e9e129265feef8f2b787c.tar.gz
rockbox-1cf053982e16a4d1e42e9e129265feef8f2b787c.zip
Now wakes up the backlight even after a power loss
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1448 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/backlight.c10
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;
40void backlight_thread(void) 40void 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)
109void backlight_init(void) 112void 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,