From 41b235dacffda5a9970c913de18ad8eea74ab4d0 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 14 May 2008 20:26:20 +0000 Subject: Fix red. No bother with lcd power management calls in bootloader. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17508 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-e200.h | 2 ++ firmware/export/config-gigabeat.h | 2 ++ firmware/export/config-h10.h | 2 ++ firmware/export/config-iaudiox5.h | 2 ++ .../target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | 2 +- firmware/target/coldfire/iaudio/x5/backlight-x5.c | 23 ++++++++++------------ 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 58b736e27c..3a4ab69082 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h @@ -47,6 +47,7 @@ #define LCD_DEPTH 16 /* 65536 colours */ #define LCD_PIXELFORMAT RGB565 /* rgb565 */ +#ifndef BOOTLOADER /* define this if you have LCD enable function */ #define HAVE_LCD_ENABLE @@ -54,6 +55,7 @@ should be defined as well. */ #define HAVE_LCD_SLEEP #define HAVE_LCD_SLEEP_SETTING +#endif /* define this if you can flip your LCD */ #define HAVE_LCD_FLIP diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index 816796b706..8a11c936ff 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h @@ -38,6 +38,7 @@ #define LCD_DEPTH 16 /* 65k colours */ #define LCD_PIXELFORMAT RGB565 /* rgb565 */ +#ifndef BOOTLOADER /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE @@ -47,6 +48,7 @@ /* We don't use a setting but a fixed delay after the backlight has * turned off */ #define LCD_SLEEP_TIMEOUT (5*HZ) +#endif /* BOOTLOADER */ #define CONFIG_KEYPAD GIGABEAT_PAD diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h index 7e64494061..071fb0f650 100644 --- a/firmware/export/config-h10.h +++ b/firmware/export/config-h10.h @@ -47,6 +47,7 @@ #define LCD_DEPTH 16 /* 65536 colours */ #define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ +#ifndef BOOTLOADER /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE @@ -55,6 +56,7 @@ * We can currently put the lcd to sleep but it won't wake up properly */ #define HAVE_LCD_SLEEP #define HAVE_LCD_SLEEP_SETTING +#endif /* define this if you can flip your LCD */ #define HAVE_LCD_FLIP diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index d0a107b28d..0d6e50053f 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -59,6 +59,7 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_INTERLEAVED +#ifndef BOOTLOADER /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE @@ -66,6 +67,7 @@ should be defined as well. */ #define HAVE_LCD_SLEEP #define HAVE_LCD_SLEEP_SETTING +#endif #define CONFIG_KEYPAD IAUDIO_X5M5_PAD diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c index 5c268f42b8..673f76d616 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c @@ -40,7 +40,7 @@ extern struct viewport* current_vp; extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src, int width, int height); -bool lcd_enabled() +bool lcd_enabled(void) { return lcd_on; } 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) void _backlight_on(void) { int level; - lcd_enable(true); -#ifndef BOOTLOADER - _lcd_sleep_timer = 0; /* LCD should be awake already */ +#ifdef HAVE_LCD_SLEEP + backlight_lcd_sleep_countdown(false); /* stop counter */ +#endif +#ifdef HAVE_LCD_ENABLE + lcd_enable(true); /* power on lcd + visible display */ #endif level = disable_irq_save(); pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */ @@ -49,16 +51,11 @@ void _backlight_off(void) int level = disable_irq_save(); pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */ restore_irq(level); - lcd_enable(false); -#ifndef BOOTLOADER - /* Start LCD sleep countdown */ - if (_lcd_sleep_timeout < 0) - { - _lcd_sleep_timer = 0; /* Setting == Always */ - lcd_sleep(); - } - else - _lcd_sleep_timer = _lcd_sleep_timeout; +#ifdef HAVE_LCD_ENABLE + lcd_enable(false); /* power off visible display */ +#endif +#ifdef HAVE_LCD_SLEEP + backlight_lcd_sleep_countdown(true); /* start countdown */ #endif } -- cgit v1.2.3