summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 32a222929b..ccdf7a44ea 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -53,27 +53,27 @@ void backlight_thread(void)
53#ifdef HAVE_RTC 53#ifdef HAVE_RTC
54 rtc_write(0x13, 0x10); 54 rtc_write(0x13, 0x10);
55#else 55#else
56 PADR |= 0x40; 56 PADR &= ~0x4000;
57#endif 57#endif
58 } 58 }
59 break; 59 break;
60 60
61 case BACKLIGHT_OFF: 61 case BACKLIGHT_OFF:
62#ifdef HAVE_RTC 62#ifdef HAVE_RTC
63 rtc_write(0x13, 0x00); 63 rtc_write(0x13, 0x00);
64#else 64#else
65 PADR &= ~0x40; 65 PADR |= 0x4000;
66#endif 66#endif
67 break; 67 break;
68 68
69 case SYS_USB_CONNECTED: 69 case SYS_USB_CONNECTED:
70 /* Tell the USB thread that we are safe */ 70 /* Tell the USB thread that we are safe */
71 DEBUGF("backlight_thread got SYS_USB_CONNECTED\n"); 71 DEBUGF("backlight_thread got SYS_USB_CONNECTED\n");
72 usb_acknowledge(SYS_USB_CONNECTED_ACK); 72 usb_acknowledge(SYS_USB_CONNECTED_ACK);
73 73
74 /* Wait until the USB cable is extracted again */ 74 /* Wait until the USB cable is extracted again */
75 usb_wait_for_disconnect(&backlight_queue); 75 usb_wait_for_disconnect(&backlight_queue);
76 break; 76 break;
77 } 77 }
78 } 78 }
79} 79}
@@ -113,6 +113,9 @@ void backlight_init(void)
113#endif 113#endif
114 queue_init(&backlight_queue); 114 queue_init(&backlight_queue);
115 create_thread(backlight_thread, backlight_stack, 115 create_thread(backlight_thread, backlight_stack,
116 sizeof(backlight_stack), backlight_thread_name); 116 sizeof(backlight_stack), backlight_thread_name);
117
118 PAIOR |= 0x4000;
119
117 backlight_on(); 120 backlight_on();
118} 121}