summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5')
-rw-r--r--firmware/target/coldfire/iaudio/x5/backlight-x5.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/backlight-x5.c b/firmware/target/coldfire/iaudio/x5/backlight-x5.c
index 13ccad5adf..2a5da7615c 100644
--- a/firmware/target/coldfire/iaudio/x5/backlight-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/backlight-x5.c
@@ -35,9 +35,11 @@ bool _backlight_init(void)
35void _backlight_on(void) 35void _backlight_on(void)
36{ 36{
37 int level; 37 int level;
38 lcd_enable(true); 38#ifdef HAVE_LCD_SLEEP
39#ifndef BOOTLOADER 39 backlight_lcd_sleep_countdown(false); /* stop counter */
40 _lcd_sleep_timer = 0; /* LCD should be awake already */ 40#endif
41#ifdef HAVE_LCD_ENABLE
42 lcd_enable(true); /* power on lcd + visible display */
41#endif 43#endif
42 level = disable_irq_save(); 44 level = disable_irq_save();
43 pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */ 45 pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
@@ -49,16 +51,11 @@ void _backlight_off(void)
49 int level = disable_irq_save(); 51 int level = disable_irq_save();
50 pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */ 52 pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */
51 restore_irq(level); 53 restore_irq(level);
52 lcd_enable(false); 54#ifdef HAVE_LCD_ENABLE
53#ifndef BOOTLOADER 55 lcd_enable(false); /* power off visible display */
54 /* Start LCD sleep countdown */ 56#endif
55 if (_lcd_sleep_timeout < 0) 57#ifdef HAVE_LCD_SLEEP
56 { 58 backlight_lcd_sleep_countdown(true); /* start countdown */
57 _lcd_sleep_timer = 0; /* Setting == Always */
58 lcd_sleep();
59 }
60 else
61 _lcd_sleep_timer = _lcd_sleep_timeout;
62#endif 59#endif
63} 60}
64 61