forked from len0rd/rockbox
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
This commit is contained in:
parent
d731cdd0db
commit
1cf053982e
1 changed files with 7 additions and 3 deletions
|
@ -40,6 +40,7 @@ static int backlight_timeout = 5;
|
||||||
void backlight_thread(void)
|
void backlight_thread(void)
|
||||||
{
|
{
|
||||||
struct event ev;
|
struct event ev;
|
||||||
|
int tmp;
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +52,8 @@ void backlight_thread(void)
|
||||||
if(backlight_timer)
|
if(backlight_timer)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
rtc_write(0x13, 0x10);
|
tmp = rtc_read(0x0a);
|
||||||
|
rtc_write(0x0a, tmp | 0x40); /* Enable square wave */
|
||||||
#else
|
#else
|
||||||
PADR &= ~0x4000;
|
PADR &= ~0x4000;
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +62,8 @@ void backlight_thread(void)
|
||||||
|
|
||||||
case BACKLIGHT_OFF:
|
case BACKLIGHT_OFF:
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
rtc_write(0x13, 0x00);
|
tmp = rtc_read(0x0a);
|
||||||
|
rtc_write(0x0a, tmp & ~0x40); /* Disable square wave */
|
||||||
#else
|
#else
|
||||||
PADR |= 0x4000;
|
PADR |= 0x4000;
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,7 +112,8 @@ void backlight_tick(void)
|
||||||
void backlight_init(void)
|
void backlight_init(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
rtc_write(0x0a, 0x40); /* Enable square wave */
|
rtc_write(0x13, 0x10); /* 32 kHz swuare wave */
|
||||||
|
rtc_write(0x01, 0x00); /* Clear Stop bit */
|
||||||
#endif
|
#endif
|
||||||
queue_init(&backlight_queue);
|
queue_init(&backlight_queue);
|
||||||
create_thread(backlight_thread, backlight_stack,
|
create_thread(backlight_thread, backlight_stack,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue