forked from len0rd/rockbox
Onda VX747/VX777: disable LCD when backlight is off (saves power)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24167 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5313bf52b5
commit
4fdf4ad728
2 changed files with 18 additions and 4 deletions
|
|
@ -49,20 +49,27 @@ void lcd_init_device(void)
|
||||||
system_enable_irq(DMA_IRQ(DMA_LCD_CHANNEL));
|
system_enable_irq(DMA_IRQ(DMA_LCD_CHANNEL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_ENABLE
|
||||||
void lcd_enable(bool state)
|
void lcd_enable(bool state)
|
||||||
{
|
{
|
||||||
|
if(lcd_is_on == state)
|
||||||
|
return;
|
||||||
|
|
||||||
|
__cpm_start_lcd();
|
||||||
|
|
||||||
if(state)
|
if(state)
|
||||||
{
|
{
|
||||||
lcd_on();
|
lcd_on();
|
||||||
#ifdef HAVE_LCD_ENABLE
|
|
||||||
send_event(LCD_EVENT_ACTIVATION, NULL);
|
send_event(LCD_EVENT_ACTIVATION, NULL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lcd_off();
|
lcd_off();
|
||||||
|
|
||||||
|
__cpm_stop_lcd();
|
||||||
|
|
||||||
lcd_is_on = state;
|
lcd_is_on = state;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool lcd_active(void)
|
bool lcd_active(void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "jz4740.h"
|
#include "jz4740.h"
|
||||||
#include "backlight-target.h"
|
#include "backlight-target.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
|
||||||
/* PWM_CHN7 == GPIO(32*3 + 31) */
|
/* PWM_CHN7 == GPIO(32*3 + 31) */
|
||||||
#define BACKLIGHT_GPIO (32*3+31)
|
#define BACKLIGHT_GPIO (32*3+31)
|
||||||
|
|
@ -89,12 +90,18 @@ bool _backlight_init(void)
|
||||||
|
|
||||||
void _backlight_on(void)
|
void _backlight_on(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LCD_ENABLE
|
||||||
|
lcd_enable(true); /* power on lcd */
|
||||||
|
#endif
|
||||||
set_backlight_on();
|
set_backlight_on();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _backlight_off(void)
|
void _backlight_off(void)
|
||||||
{
|
{
|
||||||
set_backlight_off();
|
set_backlight_off();
|
||||||
|
#ifdef HAVE_LCD_ENABLE
|
||||||
|
lcd_enable(false); /* power off lcd */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||||
|
|
@ -108,6 +115,6 @@ void _backlight_set_brightness(int brightness)
|
||||||
/* Turn off LED supply */
|
/* Turn off LED supply */
|
||||||
void _backlight_lcd_sleep(void)
|
void _backlight_lcd_sleep(void)
|
||||||
{
|
{
|
||||||
set_backlight_off();
|
_backlight_off();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue