Add some screenshots for Sansa c200.
[Rockbox.git] / firmware / backlight.c
blobca8ffd184760d507c8c40028651577dc5d586e34
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include "config.h"
20 #include <stdlib.h>
21 #include "cpu.h"
22 #include "kernel.h"
23 #include "thread.h"
24 #include "i2c.h"
25 #include "debug.h"
26 #include "rtc.h"
27 #include "usb.h"
28 #include "power.h"
29 #include "system.h"
30 #include "button.h"
31 #include "timer.h"
32 #include "backlight.h"
34 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
35 #include "lcd.h" /* for lcd_enable() and lcd_sleep() */
36 #endif
37 #ifdef HAVE_REMOTE_LCD
38 #include "lcd-remote.h"
39 #endif
40 #ifndef SIMULATOR
41 #include "backlight-target.h"
42 #endif
44 #ifdef SIMULATOR
45 /* TODO: find a better way to do it but we need a kernel thread somewhere to
46 handle this */
47 extern void screen_dump(void);
49 static inline void __backlight_on(void)
51 sim_backlight(100);
54 static inline void __backlight_off(void)
56 sim_backlight(0);
59 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
60 static inline void __backlight_set_brightness(int val)
62 (void)val;
64 #endif
66 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
67 static inline void __buttonlight_set_brightness(int val)
69 (void)val;
71 #endif
73 #endif /* SIMULATOR */
75 #if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
77 const signed char backlight_timeout_value[19] =
79 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90
82 #define BACKLIGHT_ON 1
83 #define BACKLIGHT_OFF 2
84 #define REMOTE_BACKLIGHT_ON 3
85 #define REMOTE_BACKLIGHT_OFF 4
86 #define BACKLIGHT_UNBOOST_CPU 5
87 #ifdef HAVE_LCD_SLEEP
88 #define LCD_SLEEP 6
89 #endif
90 #ifdef HAVE_BUTTON_LIGHT
91 #define BUTTON_LIGHT_ON 7
92 #define BUTTON_LIGHT_OFF 8
93 #endif
95 static void backlight_thread(void);
96 static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)];
97 static const char backlight_thread_name[] = "backlight";
98 static struct event_queue backlight_queue;
100 static int backlight_timer;
101 static int backlight_timeout;
102 static int backlight_timeout_normal = 5*HZ;
103 #if CONFIG_CHARGING
104 static int backlight_timeout_plugged = 5*HZ;
105 #endif
106 #ifdef HAS_BUTTON_HOLD
107 static int backlight_on_button_hold = 0;
108 #endif
110 #ifdef HAVE_BUTTON_LIGHT
111 static int button_backlight_timer;
112 static int button_backlight_timeout = 5*HZ;
114 /* internal interface */
115 static void _button_backlight_on(void)
117 #ifndef SIMULATOR
118 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
119 __button_backlight_dim(false);
120 #else
121 __button_backlight_on();
122 #endif
123 #endif
126 void _button_backlight_off(void)
128 #ifndef SIMULATOR
129 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
130 if(button_backlight_timeout>0)
131 __button_backlight_dim(true);
132 else
133 #endif
134 __button_backlight_off();
135 #endif
138 /* Update state of buttonlight according to timeout setting */
139 static void buttonlight_update_state(void)
141 button_backlight_timer = button_backlight_timeout;
143 /* Buttonlight == OFF in the setting? */
144 if (button_backlight_timer < 0)
146 button_backlight_timer = 0; /* Disable the timeout */
147 _button_backlight_off();
149 else
150 _button_backlight_on();
153 /* external interface */
154 void button_backlight_on(void)
156 queue_remove_from_head(&backlight_queue, BUTTON_LIGHT_ON);
157 queue_post(&backlight_queue, BUTTON_LIGHT_ON, 0);
160 void button_backlight_off(void)
162 queue_post(&backlight_queue, BUTTON_LIGHT_OFF, 0);
165 void button_backlight_set_timeout(int index)
167 if((unsigned)index >= sizeof(backlight_timeout_value))
168 /* if given a weird value, use default */
169 index = 6;
170 button_backlight_timeout = HZ * backlight_timeout_value[index];
171 buttonlight_update_state();
174 #endif
176 #ifdef HAVE_REMOTE_LCD
177 static int remote_backlight_timer;
178 static int remote_backlight_timeout;
179 static int remote_backlight_timeout_normal = 5*HZ;
180 #if CONFIG_CHARGING
181 static int remote_backlight_timeout_plugged = 5*HZ;
182 #endif
183 #ifdef HAS_REMOTE_BUTTON_HOLD
184 static int remote_backlight_on_button_hold = 0;
185 #endif
186 #endif
188 #ifdef HAVE_LCD_SLEEP
189 const signed char lcd_sleep_timeout_value[10] =
191 -1, 0, 5, 10, 15, 20, 30, 45, 60, 90
193 static int lcd_sleep_timer;
194 static int lcd_sleep_timeout = 10*HZ;
195 #endif
197 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
198 /* backlight fading */
199 #define BL_PWM_INTERVAL 5000 /* Cycle interval in s */
200 #define BL_PWM_COUNT 100
201 static const char backlight_fade_value[8] = { 0, 1, 2, 4, 6, 8, 10, 20 };
202 static int fade_in_count = 1;
203 static int fade_out_count = 4;
205 static bool bl_timer_active = false;
206 static int bl_dim_current = 0;
207 static int bl_dim_target = 0;
208 static int bl_pwm_counter = 0;
209 static volatile int bl_cycle_counter = 0;
210 static enum {DIM_STATE_START, DIM_STATE_MAIN} bl_dim_state = DIM_STATE_START;
212 static void backlight_isr(void)
214 int timer_period;
215 bool idle = false;
217 timer_period = TIMER_FREQ / 1000 * BL_PWM_INTERVAL / 1000;
218 switch (bl_dim_state)
220 /* New cycle */
221 case DIM_STATE_START:
222 bl_pwm_counter = 0;
223 bl_cycle_counter++;
225 if (bl_dim_current > 0 && bl_dim_current < BL_PWM_COUNT)
227 __backlight_on();
228 bl_pwm_counter = bl_dim_current;
229 timer_period = timer_period * bl_pwm_counter / BL_PWM_COUNT;
230 bl_dim_state = DIM_STATE_MAIN;
232 else
234 if (bl_dim_current)
235 __backlight_on();
236 else
237 __backlight_off();
238 if (bl_dim_current == bl_dim_target)
239 idle = true;
242 break ;
244 /* Dim main screen */
245 case DIM_STATE_MAIN:
246 __backlight_off();
247 bl_dim_state = DIM_STATE_START;
248 timer_period = timer_period * (BL_PWM_COUNT - bl_pwm_counter) / BL_PWM_COUNT;
249 break ;
252 if ((bl_dim_target > bl_dim_current) && (bl_cycle_counter >= fade_in_count))
254 bl_dim_current++;
255 bl_cycle_counter = 0;
258 if ((bl_dim_target < bl_dim_current) && (bl_cycle_counter >= fade_out_count))
260 bl_dim_current--;
261 bl_cycle_counter = 0;
264 if (idle)
266 #ifdef CPU_COLDFIRE
267 queue_post(&backlight_queue, BACKLIGHT_UNBOOST_CPU, 0);
268 #endif
269 timer_unregister();
270 bl_timer_active = false;
272 else
273 timer_set_period(timer_period);
276 static void backlight_switch(void)
278 if (bl_dim_target > (BL_PWM_COUNT/2))
280 __backlight_on();
281 bl_dim_current = BL_PWM_COUNT;
283 else
285 __backlight_off();
286 bl_dim_current = 0;
290 static void backlight_release_timer(void)
292 #ifdef CPU_COLDFIRE
293 cpu_boost(false);
294 #endif
295 timer_unregister();
296 bl_timer_active = false;
297 backlight_switch();
300 static void backlight_dim(int value)
302 /* protect from extraneous calls with the same target value */
303 if (value == bl_dim_target)
304 return;
306 bl_dim_target = value;
308 if (bl_timer_active)
309 return ;
311 if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr))
313 #ifdef CPU_COLDFIRE
314 /* Prevent cpu frequency changes while dimming. */
315 cpu_boost(true);
316 #endif
317 bl_timer_active = true;
319 else
320 backlight_switch();
323 void backlight_set_fade_in(int index)
325 fade_in_count = backlight_fade_value[index];
328 void backlight_set_fade_out(int index)
330 fade_out_count = backlight_fade_value[index];
332 #endif /* defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) */
334 static void _backlight_on(void)
336 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
337 if (fade_in_count > 0)
338 backlight_dim(BL_PWM_COUNT);
339 else
341 bl_dim_target = bl_dim_current = BL_PWM_COUNT;
342 __backlight_on();
344 #elif defined(HAVE_BACKLIGHT_SET_FADING) && !defined(SIMULATOR)
345 /* call the enable from here - it takes longer than the disable */
346 lcd_enable(true);
347 __backlight_dim(false);
348 #else
349 __backlight_on();
350 #endif
351 #ifdef HAVE_LCD_SLEEP
352 lcd_sleep_timer = 0; /* LCD should be awake already */
353 #endif
356 static void _backlight_off(void)
358 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
359 if (fade_out_count > 0)
360 backlight_dim(0);
361 else
363 bl_dim_target = bl_dim_current = 0;
364 __backlight_off();
366 #elif defined(HAVE_BACKLIGHT_SET_FADING) && !defined(SIMULATOR)
367 __backlight_dim(true);
368 #else
369 __backlight_off();
370 #endif
372 #ifdef HAVE_LCD_SLEEP
373 /* Start LCD sleep countdown */
374 if (lcd_sleep_timeout < 0)
376 lcd_sleep_timer = 0; /* Setting == Always */
377 lcd_sleep();
379 else
380 lcd_sleep_timer = lcd_sleep_timeout;
381 #endif
384 #ifdef HAVE_REMOTE_LCD
385 #ifdef SIMULATOR
386 static void __remote_backlight_on(void)
388 sim_remote_backlight(100);
391 static void __remote_backlight_off(void)
393 sim_remote_backlight(0);
395 #endif /* SIMULATOR */
396 #endif /* HAVE_REMOTE_LCD */
398 /* Update state of backlight according to timeout setting */
399 static void backlight_update_state(void)
401 #ifdef HAS_BUTTON_HOLD
402 if (button_hold() && (backlight_on_button_hold != 0))
403 backlight_timeout = (backlight_on_button_hold == 2) ? 0 : -1;
404 /* always on or always off */
405 else
406 #endif
407 #if CONFIG_CHARGING
408 if (charger_inserted()
409 #ifdef HAVE_USB_POWER
410 || usb_powered()
411 #endif
413 backlight_timeout = backlight_timeout_plugged;
414 else
415 #endif
416 backlight_timeout = backlight_timeout_normal;
418 /* Backlight == OFF in the setting? */
419 if (backlight_timeout < 0)
421 backlight_timer = 0; /* Disable the timeout */
422 _backlight_off();
424 else
426 backlight_timer = backlight_timeout;
427 _backlight_on();
431 #ifdef HAVE_REMOTE_LCD
432 /* Update state of remote backlight according to timeout setting */
433 static void remote_backlight_update_state(void)
435 #ifdef HAS_REMOTE_BUTTON_HOLD
436 if (remote_button_hold() && (remote_backlight_on_button_hold != 0))
437 remote_backlight_timeout = (remote_backlight_on_button_hold == 2)
438 ? 0 : -1; /* always on or always off */
439 else
440 #endif
441 #if CONFIG_CHARGING
442 if (charger_inserted()
443 #ifdef HAVE_USB_POWER
444 || usb_powered()
445 #endif
447 remote_backlight_timeout = remote_backlight_timeout_plugged;
448 else
449 #endif
450 remote_backlight_timeout = remote_backlight_timeout_normal;
452 /* Backlight == OFF in the setting? */
453 if (remote_backlight_timeout < 0)
455 remote_backlight_timer = 0; /* Disable the timeout */
456 __remote_backlight_off();
458 else
460 remote_backlight_timer = remote_backlight_timeout;
461 __remote_backlight_on();
464 #endif /* HAVE_REMOTE_LCD */
466 void backlight_thread(void)
468 struct event ev;
469 bool locked = false;
471 while(1)
473 queue_wait(&backlight_queue, &ev);
474 switch(ev.id)
475 { /* These events must always be processed */
476 #if defined(HAVE_BACKLIGHT_PWM_FADING) && defined(CPU_COLDFIRE) \
477 && !defined(SIMULATOR)
478 case BACKLIGHT_UNBOOST_CPU:
479 cpu_boost(false);
480 break;
481 #endif
483 #if defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR)
484 /* Here for now or else the aggressive init messes up scrolling */
485 case SYS_REMOTE_PLUGGED:
486 lcd_remote_on();
487 lcd_remote_update();
488 break;
490 case SYS_REMOTE_UNPLUGGED:
491 lcd_remote_off();
492 break;
493 #endif /* defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR) */
494 #ifdef SIMULATOR
495 /* This one here too for lack of a better place */
496 case SYS_SCREENDUMP:
497 screen_dump();
498 break;
499 #endif
500 case SYS_USB_CONNECTED:
501 /* Tell the USB thread that we are safe */
502 DEBUGF("backlight_thread got SYS_USB_CONNECTED\n");
503 usb_acknowledge(SYS_USB_CONNECTED_ACK);
504 break;
506 case SYS_USB_DISCONNECTED:
507 usb_acknowledge(SYS_USB_DISCONNECTED_ACK);
508 break;
510 if (locked)
511 continue;
513 switch(ev.id)
514 { /* These events are only processed if backlight isn't locked */
515 #ifdef HAVE_REMOTE_LCD
516 case REMOTE_BACKLIGHT_ON:
517 remote_backlight_update_state();
518 break;
520 case REMOTE_BACKLIGHT_OFF:
521 remote_backlight_timer = 0; /* Disable the timeout */
522 __remote_backlight_off();
523 break;
524 #endif /* HAVE_REMOTE_LCD */
526 case BACKLIGHT_ON:
527 backlight_update_state();
528 break;
530 case BACKLIGHT_OFF:
531 backlight_timer = 0; /* Disable the timeout */
532 _backlight_off();
533 break;
535 #ifdef HAVE_LCD_SLEEP
536 case LCD_SLEEP:
537 lcd_sleep();
538 break;
539 #endif
540 #ifdef HAVE_BUTTON_LIGHT
541 case BUTTON_LIGHT_ON:
542 buttonlight_update_state();
543 break;
545 case BUTTON_LIGHT_OFF:
546 button_backlight_timer = 0;
547 _button_backlight_off();
548 break;
549 #endif
551 case SYS_POWEROFF: /* Lock backlight on poweroff so it doesn't */
552 locked = true; /* go off before power is actually cut. */
553 /* fall through */
554 #if CONFIG_CHARGING
555 case SYS_CHARGER_CONNECTED:
556 case SYS_CHARGER_DISCONNECTED:
557 #endif
558 backlight_update_state();
559 #ifdef HAVE_REMOTE_LCD
560 remote_backlight_update_state();
561 #endif
562 break;
564 } /* end while */
567 static void backlight_tick(void)
569 if(backlight_timer)
571 backlight_timer--;
572 if(backlight_timer == 0)
574 backlight_off();
577 #ifdef HAVE_LCD_SLEEP
578 else if(lcd_sleep_timer)
580 lcd_sleep_timer--;
581 if(lcd_sleep_timer == 0)
583 /* Queue on bl thread or freeze! */
584 queue_post(&backlight_queue, LCD_SLEEP, 0);
587 #endif /* HAVE_LCD_SLEEP */
589 #ifdef HAVE_REMOTE_LCD
590 if(remote_backlight_timer)
592 remote_backlight_timer--;
593 if(remote_backlight_timer == 0)
595 remote_backlight_off();
598 #endif /* HAVE_REMOVE_LCD */
599 #ifdef HAVE_BUTTON_LIGHT
600 if (button_backlight_timer)
602 button_backlight_timer--;
603 if (button_backlight_timer == 0)
605 button_backlight_off();
608 #endif /* HAVE_BUTTON_LIGHT */
611 void backlight_init(void)
613 queue_init(&backlight_queue, true);
614 queue_set_irq_safe(&backlight_queue, true);
616 #ifndef SIMULATOR
617 if (__backlight_init())
619 # ifdef HAVE_BACKLIGHT_PWM_FADING
620 /* If backlight is already on, don't fade in. */
621 bl_dim_current = BL_PWM_COUNT;
622 bl_dim_target = BL_PWM_COUNT;
623 # endif
625 #endif
626 /* Leave all lights as set by the bootloader here. The settings load will
627 * call the appropriate backlight_set_*() functions, only changing light
628 * status if necessary. */
630 create_thread(backlight_thread, backlight_stack,
631 sizeof(backlight_stack), backlight_thread_name
632 IF_PRIO(, PRIORITY_SYSTEM)
633 IF_COP(, CPU, false));
634 tick_add_task(backlight_tick);
637 void backlight_on(void)
639 queue_remove_from_head(&backlight_queue, BACKLIGHT_ON);
640 queue_post(&backlight_queue, BACKLIGHT_ON, 0);
643 void backlight_off(void)
645 queue_post(&backlight_queue, BACKLIGHT_OFF, 0);
648 /* returns true when the backlight is on OR when it's set to always off */
649 bool is_backlight_on(void)
651 if (backlight_timer || backlight_timeout <= 0)
652 return true;
653 else
654 return false;
657 /* return value in ticks; 0 means always on, <0 means always off */
658 int backlight_get_current_timeout(void)
660 return backlight_timeout;
663 void backlight_set_timeout(int index)
665 if((unsigned)index >= sizeof(backlight_timeout_value))
666 /* if given a weird value, use default */
667 index = 6;
668 backlight_timeout_normal = HZ * backlight_timeout_value[index];
669 backlight_update_state();
672 #if CONFIG_CHARGING
673 void backlight_set_timeout_plugged(int index)
675 if((unsigned)index >= sizeof(backlight_timeout_value))
676 /* if given a weird value, use default */
677 index = 6;
678 backlight_timeout_plugged = HZ * backlight_timeout_value[index];
679 backlight_update_state();
681 #endif /* CONFIG_CHARGING */
683 #ifdef HAS_BUTTON_HOLD
684 /* Hold button change event handler. */
685 void backlight_hold_changed(bool hold_button)
687 if (!hold_button || (backlight_on_button_hold > 0))
688 /* if unlocked or override in effect */
689 backlight_on();
692 void backlight_set_on_button_hold(int index)
694 if ((unsigned)index >= 3)
695 /* if given a weird value, use default */
696 index = 0;
698 backlight_on_button_hold = index;
699 backlight_update_state();
701 #endif /* HAS_BUTTON_HOLD */
703 #ifdef HAVE_LCD_SLEEP
704 void lcd_set_sleep_after_backlight_off(int index)
706 if ((unsigned)index >= sizeof(lcd_sleep_timeout_value))
707 /* if given a weird value, use default */
708 index = 3;
710 lcd_sleep_timeout = HZ * lcd_sleep_timeout_value[index];
712 if (backlight_timer > 0 || backlight_get_current_timeout() == 0)
713 /* Timer will be set when bl turns off or bl set to on. */
714 return;
716 /* Backlight is Off */
717 if (lcd_sleep_timeout < 0)
718 lcd_sleep_timer = 1; /* Always - sleep next tick */
719 else
720 lcd_sleep_timer = lcd_sleep_timeout; /* Never, other */
722 #endif /* HAVE_LCD_SLEEP */
724 #ifdef HAVE_REMOTE_LCD
725 void remote_backlight_on(void)
727 queue_post(&backlight_queue, REMOTE_BACKLIGHT_ON, 0);
730 void remote_backlight_off(void)
732 queue_post(&backlight_queue, REMOTE_BACKLIGHT_OFF, 0);
735 void remote_backlight_set_timeout(int index)
737 if((unsigned)index >= sizeof(backlight_timeout_value))
738 /* if given a weird value, use default */
739 index=6;
740 remote_backlight_timeout_normal = HZ * backlight_timeout_value[index];
741 remote_backlight_update_state();
744 #if CONFIG_CHARGING
745 void remote_backlight_set_timeout_plugged(int index)
747 if((unsigned)index >= sizeof(backlight_timeout_value))
748 /* if given a weird value, use default */
749 index=6;
750 remote_backlight_timeout_plugged = HZ * backlight_timeout_value[index];
751 remote_backlight_update_state();
753 #endif /* CONFIG_CHARGING */
755 #ifdef HAS_REMOTE_BUTTON_HOLD
756 /* Remote hold button change event handler. */
757 void remote_backlight_hold_changed(bool rc_hold_button)
759 if (!rc_hold_button || (remote_backlight_on_button_hold > 0))
760 /* if unlocked or override */
761 remote_backlight_on();
764 void remote_backlight_set_on_button_hold(int index)
766 if ((unsigned)index >= 3)
767 /* if given a weird value, use default */
768 index = 0;
770 remote_backlight_on_button_hold = index;
771 remote_backlight_update_state();
773 #endif /* HAS_REMOTE_BUTTON_HOLD */
775 /* return value in ticks; 0 means always on, <0 means always off */
776 int remote_backlight_get_current_timeout(void)
778 return remote_backlight_timeout;
781 /* returns true when the backlight is on OR when it's set to always off */
782 bool is_remote_backlight_on(void)
784 if (remote_backlight_timer != 0 || remote_backlight_timeout <= 0)
785 return true;
786 else
787 return false;
790 #endif /* HAVE_REMOTE_LCD */
792 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
793 void backlight_set_brightness(int val)
795 if (val < MIN_BRIGHTNESS_SETTING)
796 val = MIN_BRIGHTNESS_SETTING;
797 else if (val > MAX_BRIGHTNESS_SETTING)
798 val = MAX_BRIGHTNESS_SETTING;
800 __backlight_set_brightness(val);
802 #endif /* HAVE_BACKLIGHT_BRIGHTNESS */
804 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
805 void buttonlight_set_brightness(int val)
807 if (val < MIN_BRIGHTNESS_SETTING)
808 val = MIN_BRIGHTNESS_SETTING;
809 else if (val > MAX_BRIGHTNESS_SETTING)
810 val = MAX_BRIGHTNESS_SETTING;
812 __buttonlight_set_brightness(val);
814 #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
816 #else /* !defined(HAVE_BACKLIGHT) || defined(BOOTLOADER)
817 -- no backlight, empty dummy functions */
819 #if defined(BOOTLOADER) && defined(HAVE_BACKLIGHT)
820 void backlight_init(void)
822 (void)__backlight_init();
823 __backlight_on();
825 #endif
827 void backlight_on(void) {}
828 void backlight_off(void) {}
829 void button_backlight_on(void) {}
830 void backlight_set_timeout(int index) {(void)index;}
831 bool is_backlight_on(void) {return true;}
832 #ifdef HAVE_REMOTE_LCD
833 void remote_backlight_on(void) {}
834 void remote_backlight_off(void) {}
835 void remote_backlight_set_timeout(int index) {(void)index;}
836 bool is_remote_backlight_on(void) {return true;}
837 #endif /* HAVE_REMOTE_LCD */
838 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
839 void backlight_set_brightness(int val) { (void)val; }
840 #endif
841 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
842 void buttonlight_set_brightness(int val) { (void)val; }
843 #endif
844 #endif /* defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER) */