Accept FS #7678 - Chinese simp language update
[Rockbox.git] / firmware / backlight.c
blob2ba4d6ed1d9c802cf3597eb8c280434209bd80c3
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 static inline void __backlight_on(void)
47 sim_backlight(100);
50 static inline void __backlight_off(void)
52 sim_backlight(0);
55 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
56 static inline void __backlight_set_brightness(int val)
58 (void)val;
60 #endif
62 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
63 static inline void __buttonlight_set_brightness(int val)
65 (void)val;
67 #endif
69 #endif /* SIMULATOR */
71 #if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
73 const signed char backlight_timeout_value[19] =
75 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90
78 #define BACKLIGHT_ON 1
79 #define BACKLIGHT_OFF 2
80 #define REMOTE_BACKLIGHT_ON 3
81 #define REMOTE_BACKLIGHT_OFF 4
82 #define BACKLIGHT_UNBOOST_CPU 5
83 #ifdef HAVE_LCD_SLEEP
84 #define LCD_SLEEP 6
85 #endif
86 #ifdef HAVE_BUTTON_LIGHT
87 #define BUTTON_LIGHT_ON 7
88 #define BUTTON_LIGHT_OFF 8
89 #endif
91 static void backlight_thread(void);
92 static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)];
93 static const char backlight_thread_name[] = "backlight";
94 static struct event_queue backlight_queue;
96 static int backlight_timer;
97 static int backlight_timeout;
98 static int backlight_timeout_normal = 5*HZ;
99 #if CONFIG_CHARGING
100 static int backlight_timeout_plugged = 5*HZ;
101 #endif
102 #ifdef HAS_BUTTON_HOLD
103 static int backlight_on_button_hold = 0;
104 #endif
106 #ifdef HAVE_BUTTON_LIGHT
107 static int button_backlight_timer;
108 static int button_backlight_timeout = 5*HZ;
110 /* internal interface */
111 static void _button_backlight_on(void)
113 #ifndef SIMULATOR
114 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
115 __button_backlight_dim(false);
116 #else
117 __button_backlight_on();
118 #endif
119 #endif
122 void _button_backlight_off(void)
124 #ifndef SIMULATOR
125 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
126 if(button_backlight_timeout>0)
127 __button_backlight_dim(true);
128 else
129 #endif
130 __button_backlight_off();
131 #endif
134 /* Update state of buttonlight according to timeout setting */
135 static void buttonlight_update_state(void)
137 button_backlight_timer = button_backlight_timeout;
139 /* Buttonlight == OFF in the setting? */
140 if (button_backlight_timer < 0)
142 button_backlight_timer = 0; /* Disable the timeout */
143 _button_backlight_off();
145 else
146 _button_backlight_on();
149 /* external interface */
150 void button_backlight_on(void)
152 queue_remove_from_head(&backlight_queue, BUTTON_LIGHT_ON);
153 queue_post(&backlight_queue, BUTTON_LIGHT_ON, 0);
156 void button_backlight_off(void)
158 queue_post(&backlight_queue, BUTTON_LIGHT_OFF, 0);
161 void button_backlight_set_timeout(int index)
163 if((unsigned)index >= sizeof(backlight_timeout_value))
164 /* if given a weird value, use default */
165 index = 6;
166 button_backlight_timeout = HZ * backlight_timeout_value[index];
167 buttonlight_update_state();
170 #endif
172 #ifdef HAVE_REMOTE_LCD
173 static int remote_backlight_timer;
174 static int remote_backlight_timeout;
175 static int remote_backlight_timeout_normal = 5*HZ;
176 #if CONFIG_CHARGING
177 static int remote_backlight_timeout_plugged = 5*HZ;
178 #endif
179 #ifdef HAS_REMOTE_BUTTON_HOLD
180 static int remote_backlight_on_button_hold = 0;
181 #endif
182 #endif
184 #ifdef HAVE_LCD_SLEEP
185 const signed char lcd_sleep_timeout_value[10] =
187 -1, 0, 5, 10, 15, 20, 30, 45, 60, 90
189 static int lcd_sleep_timer;
190 static int lcd_sleep_timeout = 10*HZ;
191 #endif
193 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
194 /* backlight fading */
195 #define BL_PWM_INTERVAL 5000 /* Cycle interval in s */
196 #define BL_PWM_COUNT 100
197 static const char backlight_fade_value[8] = { 0, 1, 2, 4, 6, 8, 10, 20 };
198 static int fade_in_count = 1;
199 static int fade_out_count = 4;
201 static bool bl_timer_active = false;
202 static int bl_dim_current = 0;
203 static int bl_dim_target = 0;
204 static int bl_pwm_counter = 0;
205 static volatile int bl_cycle_counter = 0;
206 static enum {DIM_STATE_START, DIM_STATE_MAIN} bl_dim_state = DIM_STATE_START;
208 static void backlight_isr(void)
210 int timer_period;
211 bool idle = false;
213 timer_period = TIMER_FREQ / 1000 * BL_PWM_INTERVAL / 1000;
214 switch (bl_dim_state)
216 /* New cycle */
217 case DIM_STATE_START:
218 bl_pwm_counter = 0;
219 bl_cycle_counter++;
221 if (bl_dim_current > 0 && bl_dim_current < BL_PWM_COUNT)
223 __backlight_on();
224 bl_pwm_counter = bl_dim_current;
225 timer_period = timer_period * bl_pwm_counter / BL_PWM_COUNT;
226 bl_dim_state = DIM_STATE_MAIN;
228 else
230 if (bl_dim_current)
231 __backlight_on();
232 else
233 __backlight_off();
234 if (bl_dim_current == bl_dim_target)
235 idle = true;
238 break ;
240 /* Dim main screen */
241 case DIM_STATE_MAIN:
242 __backlight_off();
243 bl_dim_state = DIM_STATE_START;
244 timer_period = timer_period * (BL_PWM_COUNT - bl_pwm_counter) / BL_PWM_COUNT;
245 break ;
248 if ((bl_dim_target > bl_dim_current) && (bl_cycle_counter >= fade_in_count))
250 bl_dim_current++;
251 bl_cycle_counter = 0;
254 if ((bl_dim_target < bl_dim_current) && (bl_cycle_counter >= fade_out_count))
256 bl_dim_current--;
257 bl_cycle_counter = 0;
260 if (idle)
262 #ifdef CPU_COLDFIRE
263 queue_post(&backlight_queue, BACKLIGHT_UNBOOST_CPU, 0);
264 #endif
265 timer_unregister();
266 bl_timer_active = false;
268 else
269 timer_set_period(timer_period);
272 static void backlight_switch(void)
274 if (bl_dim_target > (BL_PWM_COUNT/2))
276 __backlight_on();
277 bl_dim_current = BL_PWM_COUNT;
279 else
281 __backlight_off();
282 bl_dim_current = 0;
286 static void backlight_release_timer(void)
288 #ifdef CPU_COLDFIRE
289 cpu_boost(false);
290 #endif
291 timer_unregister();
292 bl_timer_active = false;
293 backlight_switch();
296 static void backlight_dim(int value)
298 /* protect from extraneous calls with the same target value */
299 if (value == bl_dim_target)
300 return;
302 bl_dim_target = value;
304 if (bl_timer_active)
305 return ;
307 if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr))
309 #ifdef CPU_COLDFIRE
310 /* Prevent cpu frequency changes while dimming. */
311 cpu_boost(true);
312 #endif
313 bl_timer_active = true;
315 else
316 backlight_switch();
319 void backlight_set_fade_in(int index)
321 fade_in_count = backlight_fade_value[index];
324 void backlight_set_fade_out(int index)
326 fade_out_count = backlight_fade_value[index];
328 #endif /* defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) */
330 static void _backlight_on(void)
332 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
333 if (fade_in_count > 0)
334 backlight_dim(BL_PWM_COUNT);
335 else
337 bl_dim_target = bl_dim_current = BL_PWM_COUNT;
338 __backlight_on();
340 #elif defined(HAVE_BACKLIGHT_SET_FADING) && !defined(SIMULATOR)
341 /* call the enable from here - it takes longer than the disable */
342 lcd_enable(true);
343 __backlight_dim(false);
344 #else
345 __backlight_on();
346 #endif
347 #ifdef HAVE_LCD_SLEEP
348 lcd_sleep_timer = 0; /* LCD should be awake already */
349 #endif
352 static void _backlight_off(void)
354 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
355 if (fade_out_count > 0)
356 backlight_dim(0);
357 else
359 bl_dim_target = bl_dim_current = 0;
360 __backlight_off();
362 #elif defined(HAVE_BACKLIGHT_SET_FADING) && !defined(SIMULATOR)
363 __backlight_dim(true);
364 #else
365 __backlight_off();
366 #endif
368 #ifdef HAVE_LCD_SLEEP
369 /* Start LCD sleep countdown */
370 if (lcd_sleep_timeout < 0)
372 lcd_sleep_timer = 0; /* Setting == Always */
373 lcd_sleep();
375 else
376 lcd_sleep_timer = lcd_sleep_timeout;
377 #endif
380 #ifdef HAVE_REMOTE_LCD
381 #ifdef SIMULATOR
382 static void __remote_backlight_on(void)
384 sim_remote_backlight(100);
387 static void __remote_backlight_off(void)
389 sim_remote_backlight(0);
391 #endif /* SIMULATOR */
392 #endif /* HAVE_REMOTE_LCD */
394 /* Update state of backlight according to timeout setting */
395 static void backlight_update_state(void)
397 #ifdef HAS_BUTTON_HOLD
398 if (button_hold() && (backlight_on_button_hold != 0))
399 backlight_timeout = (backlight_on_button_hold == 2) ? 0 : -1;
400 /* always on or always off */
401 else
402 #endif
403 #if CONFIG_CHARGING
404 if (charger_inserted()
405 #ifdef HAVE_USB_POWER
406 || usb_powered()
407 #endif
409 backlight_timeout = backlight_timeout_plugged;
410 else
411 #endif
412 backlight_timeout = backlight_timeout_normal;
414 /* Backlight == OFF in the setting? */
415 if (backlight_timeout < 0)
417 backlight_timer = 0; /* Disable the timeout */
418 _backlight_off();
420 else
422 backlight_timer = backlight_timeout;
423 _backlight_on();
427 #ifdef HAVE_REMOTE_LCD
428 /* Update state of remote backlight according to timeout setting */
429 static void remote_backlight_update_state(void)
431 #ifdef HAS_REMOTE_BUTTON_HOLD
432 if (remote_button_hold() && (remote_backlight_on_button_hold != 0))
433 remote_backlight_timeout = (remote_backlight_on_button_hold == 2)
434 ? 0 : -1; /* always on or always off */
435 else
436 #endif
437 #if CONFIG_CHARGING
438 if (charger_inserted()
439 #ifdef HAVE_USB_POWER
440 || usb_powered()
441 #endif
443 remote_backlight_timeout = remote_backlight_timeout_plugged;
444 else
445 #endif
446 remote_backlight_timeout = remote_backlight_timeout_normal;
448 /* Backlight == OFF in the setting? */
449 if (remote_backlight_timeout < 0)
451 remote_backlight_timer = 0; /* Disable the timeout */
452 __remote_backlight_off();
454 else
456 remote_backlight_timer = remote_backlight_timeout;
457 __remote_backlight_on();
460 #endif /* HAVE_REMOTE_LCD */
462 void backlight_thread(void)
464 struct event ev;
465 bool locked = false;
467 while(1)
469 queue_wait(&backlight_queue, &ev);
470 switch(ev.id)
471 { /* These events must always be processed */
472 #if defined(HAVE_BACKLIGHT_PWM_FADING) && defined(CPU_COLDFIRE) \
473 && !defined(SIMULATOR)
474 case BACKLIGHT_UNBOOST_CPU:
475 cpu_boost(false);
476 break;
477 #endif
479 #if defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR)
480 /* Here for now or else the aggressive init messes up scrolling */
481 case SYS_REMOTE_PLUGGED:
482 lcd_remote_on();
483 lcd_remote_update();
484 break;
486 case SYS_REMOTE_UNPLUGGED:
487 lcd_remote_off();
488 break;
489 #endif /* defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR) */
491 case SYS_USB_CONNECTED:
492 /* Tell the USB thread that we are safe */
493 DEBUGF("backlight_thread got SYS_USB_CONNECTED\n");
494 usb_acknowledge(SYS_USB_CONNECTED_ACK);
495 break;
497 case SYS_USB_DISCONNECTED:
498 usb_acknowledge(SYS_USB_DISCONNECTED_ACK);
499 break;
501 if (locked)
502 continue;
504 switch(ev.id)
505 { /* These events are only processed if backlight isn't locked */
506 #ifdef HAVE_REMOTE_LCD
507 case REMOTE_BACKLIGHT_ON:
508 remote_backlight_update_state();
509 break;
511 case REMOTE_BACKLIGHT_OFF:
512 remote_backlight_timer = 0; /* Disable the timeout */
513 __remote_backlight_off();
514 break;
515 #endif /* HAVE_REMOTE_LCD */
517 case BACKLIGHT_ON:
518 backlight_update_state();
519 break;
521 case BACKLIGHT_OFF:
522 backlight_timer = 0; /* Disable the timeout */
523 _backlight_off();
524 break;
526 #ifdef HAVE_LCD_SLEEP
527 case LCD_SLEEP:
528 lcd_sleep();
529 break;
530 #endif
531 #ifdef HAVE_BUTTON_LIGHT
532 case BUTTON_LIGHT_ON:
533 buttonlight_update_state();
534 break;
536 case BUTTON_LIGHT_OFF:
537 button_backlight_timer = 0;
538 _button_backlight_off();
539 break;
540 #endif
542 case SYS_POWEROFF: /* Lock backlight on poweroff so it doesn't */
543 locked = true; /* go off before power is actually cut. */
544 /* fall through */
545 #if CONFIG_CHARGING
546 case SYS_CHARGER_CONNECTED:
547 case SYS_CHARGER_DISCONNECTED:
548 #endif
549 backlight_update_state();
550 #ifdef HAVE_REMOTE_LCD
551 remote_backlight_update_state();
552 #endif
553 break;
555 } /* end while */
558 static void backlight_tick(void)
560 if(backlight_timer)
562 backlight_timer--;
563 if(backlight_timer == 0)
565 backlight_off();
568 #ifdef HAVE_LCD_SLEEP
569 else if(lcd_sleep_timer)
571 lcd_sleep_timer--;
572 if(lcd_sleep_timer == 0)
574 /* Queue on bl thread or freeze! */
575 queue_post(&backlight_queue, LCD_SLEEP, 0);
578 #endif /* HAVE_LCD_SLEEP */
580 #ifdef HAVE_REMOTE_LCD
581 if(remote_backlight_timer)
583 remote_backlight_timer--;
584 if(remote_backlight_timer == 0)
586 remote_backlight_off();
589 #endif /* HAVE_REMOVE_LCD */
590 #ifdef HAVE_BUTTON_LIGHT
591 if (button_backlight_timer)
593 button_backlight_timer--;
594 if (button_backlight_timer == 0)
596 button_backlight_off();
599 #endif /* HAVE_BUTTON_LIGHT */
602 void backlight_init(void)
604 queue_init(&backlight_queue, true);
605 queue_set_irq_safe(&backlight_queue, true);
607 #ifndef SIMULATOR
608 if (__backlight_init())
610 # ifdef HAVE_BACKLIGHT_PWM_FADING
611 /* If backlight is already on, don't fade in. */
612 bl_dim_current = BL_PWM_COUNT;
613 bl_dim_target = BL_PWM_COUNT;
614 # endif
616 #endif
617 backlight_on();
618 #ifdef HAVE_REMOTE_LCD
619 remote_backlight_on();
620 #endif
621 #ifdef HAVE_BUTTON_LIGHT
622 button_backlight_on();
623 #endif
625 create_thread(backlight_thread, backlight_stack,
626 sizeof(backlight_stack), backlight_thread_name
627 IF_PRIO(, PRIORITY_SYSTEM)
628 IF_COP(, CPU, false));
629 tick_add_task(backlight_tick);
632 void backlight_on(void)
634 queue_remove_from_head(&backlight_queue, BACKLIGHT_ON);
635 queue_post(&backlight_queue, BACKLIGHT_ON, 0);
638 void backlight_off(void)
640 queue_post(&backlight_queue, BACKLIGHT_OFF, 0);
643 /* returns true when the backlight is on OR when it's set to always off */
644 bool is_backlight_on(void)
646 if (backlight_timer || backlight_timeout <= 0)
647 return true;
648 else
649 return false;
652 /* return value in ticks; 0 means always on, <0 means always off */
653 int backlight_get_current_timeout(void)
655 return backlight_timeout;
658 void backlight_set_timeout(int index)
660 if((unsigned)index >= sizeof(backlight_timeout_value))
661 /* if given a weird value, use default */
662 index = 6;
663 backlight_timeout_normal = HZ * backlight_timeout_value[index];
664 backlight_update_state();
667 #if CONFIG_CHARGING
668 void backlight_set_timeout_plugged(int index)
670 if((unsigned)index >= sizeof(backlight_timeout_value))
671 /* if given a weird value, use default */
672 index = 6;
673 backlight_timeout_plugged = HZ * backlight_timeout_value[index];
674 backlight_update_state();
676 #endif /* CONFIG_CHARGING */
678 #ifdef HAS_BUTTON_HOLD
679 /* Hold button change event handler. */
680 void backlight_hold_changed(bool hold_button)
682 if (!hold_button || (backlight_on_button_hold > 0))
683 /* if unlocked or override in effect */
684 backlight_on();
687 void backlight_set_on_button_hold(int index)
689 if ((unsigned)index >= 3)
690 /* if given a weird value, use default */
691 index = 0;
693 backlight_on_button_hold = index;
694 backlight_update_state();
696 #endif /* HAS_BUTTON_HOLD */
698 #ifdef HAVE_LCD_SLEEP
699 void lcd_set_sleep_after_backlight_off(int index)
701 if ((unsigned)index >= sizeof(lcd_sleep_timeout_value))
702 /* if given a weird value, use default */
703 index = 3;
705 lcd_sleep_timeout = HZ * lcd_sleep_timeout_value[index];
707 if (backlight_timer > 0 || backlight_get_current_timeout() == 0)
708 /* Timer will be set when bl turns off or bl set to on. */
709 return;
711 /* Backlight is Off */
712 if (lcd_sleep_timeout < 0)
713 lcd_sleep_timer = 1; /* Always - sleep next tick */
714 else
715 lcd_sleep_timer = lcd_sleep_timeout; /* Never, other */
717 #endif /* HAVE_LCD_SLEEP */
719 #ifdef HAVE_REMOTE_LCD
720 void remote_backlight_on(void)
722 queue_post(&backlight_queue, REMOTE_BACKLIGHT_ON, 0);
725 void remote_backlight_off(void)
727 queue_post(&backlight_queue, REMOTE_BACKLIGHT_OFF, 0);
730 void remote_backlight_set_timeout(int index)
732 if((unsigned)index >= sizeof(backlight_timeout_value))
733 /* if given a weird value, use default */
734 index=6;
735 remote_backlight_timeout_normal = HZ * backlight_timeout_value[index];
736 remote_backlight_update_state();
739 #if CONFIG_CHARGING
740 void remote_backlight_set_timeout_plugged(int index)
742 if((unsigned)index >= sizeof(backlight_timeout_value))
743 /* if given a weird value, use default */
744 index=6;
745 remote_backlight_timeout_plugged = HZ * backlight_timeout_value[index];
746 remote_backlight_update_state();
748 #endif /* CONFIG_CHARGING */
750 #ifdef HAS_REMOTE_BUTTON_HOLD
751 /* Remote hold button change event handler. */
752 void remote_backlight_hold_changed(bool rc_hold_button)
754 if (!rc_hold_button || (remote_backlight_on_button_hold > 0))
755 /* if unlocked or override */
756 remote_backlight_on();
759 void remote_backlight_set_on_button_hold(int index)
761 if ((unsigned)index >= 3)
762 /* if given a weird value, use default */
763 index = 0;
765 remote_backlight_on_button_hold = index;
766 remote_backlight_update_state();
768 #endif /* HAS_REMOTE_BUTTON_HOLD */
770 /* return value in ticks; 0 means always on, <0 means always off */
771 int remote_backlight_get_current_timeout(void)
773 return remote_backlight_timeout;
776 /* returns true when the backlight is on OR when it's set to always off */
777 bool is_remote_backlight_on(void)
779 if (remote_backlight_timer != 0 || remote_backlight_timeout <= 0)
780 return true;
781 else
782 return false;
785 #endif /* HAVE_REMOTE_LCD */
787 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
788 void backlight_set_brightness(int val)
790 if (val < MIN_BRIGHTNESS_SETTING)
791 val = MIN_BRIGHTNESS_SETTING;
792 else if (val > MAX_BRIGHTNESS_SETTING)
793 val = MAX_BRIGHTNESS_SETTING;
795 __backlight_set_brightness(val);
797 #endif /* HAVE_BACKLIGHT_BRIGHTNESS */
799 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
800 void buttonlight_set_brightness(int val)
802 if (val < MIN_BRIGHTNESS_SETTING)
803 val = MIN_BRIGHTNESS_SETTING;
804 else if (val > MAX_BRIGHTNESS_SETTING)
805 val = MAX_BRIGHTNESS_SETTING;
807 __buttonlight_set_brightness(val);
809 #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
811 #else /* !defined(HAVE_BACKLIGHT) || defined(BOOTLOADER)
812 -- no backlight, empty dummy functions */
814 #if defined(BOOTLOADER) && defined(HAVE_BACKLIGHT)
815 void backlight_init(void)
817 (void)__backlight_init();
818 __backlight_on();
820 #endif
822 void backlight_on(void) {}
823 void backlight_off(void) {}
824 void button_backlight_on(void) {}
825 void backlight_set_timeout(int index) {(void)index;}
826 bool is_backlight_on(void) {return true;}
827 #ifdef HAVE_REMOTE_LCD
828 void remote_backlight_on(void) {}
829 void remote_backlight_off(void) {}
830 void remote_backlight_set_timeout(int index) {(void)index;}
831 bool is_remote_backlight_on(void) {return true;}
832 #endif /* HAVE_REMOTE_LCD */
833 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
834 void backlight_set_brightness(int val) { (void)val; }
835 #endif
836 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
837 void buttonlight_set_brightness(int val) { (void)val; }
838 #endif
839 #endif /* defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER) */