forked from len0rd/rockbox
Fix bootloaders, and the backlight-modded Ondio build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15600 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ef12b3b5c6
commit
f4c5c6aa62
6 changed files with 26 additions and 3 deletions
|
@ -27,6 +27,12 @@ void _backlight_led_on(void);
|
||||||
void _backlight_led_off(void);
|
void _backlight_led_off(void);
|
||||||
void _backlight_hw_enable(bool on);
|
void _backlight_hw_enable(bool on);
|
||||||
|
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
#define _backlight_on() do { _backlight_hw_enable(true); \
|
||||||
|
_backlight_led_on(); } while(0)
|
||||||
|
#define _backlight_off() do { _backlight_led_off(); \
|
||||||
|
_backlight_hw_enable(false); } while(0)
|
||||||
|
#else /* !BOOTLOADER */
|
||||||
#define _backlight_on_isr() _backlight_led_on()
|
#define _backlight_on_isr() _backlight_led_on()
|
||||||
#define _backlight_off_isr() _backlight_led_off()
|
#define _backlight_off_isr() _backlight_led_off()
|
||||||
#define _backlight_on_normal() do { _backlight_hw_enable(true); \
|
#define _backlight_on_normal() do { _backlight_hw_enable(true); \
|
||||||
|
@ -34,6 +40,7 @@ void _backlight_hw_enable(bool on);
|
||||||
#define _backlight_off_normal() do { _backlight_led_off(); \
|
#define _backlight_off_normal() do { _backlight_led_off(); \
|
||||||
_backlight_hw_enable(false); } while(0)
|
_backlight_hw_enable(false); } while(0)
|
||||||
#define _BACKLIGHT_FADE_ENABLE
|
#define _BACKLIGHT_FADE_ENABLE
|
||||||
|
#endif /* !BOOTLOADER */
|
||||||
|
|
||||||
#elif defined HAVE_BACKLIGHT_PWM_FADING
|
#elif defined HAVE_BACKLIGHT_PWM_FADING
|
||||||
|
|
||||||
|
@ -41,10 +48,15 @@ void _backlight_hw_enable(bool on);
|
||||||
void _backlight_hw_on(void);
|
void _backlight_hw_on(void);
|
||||||
void _backlight_hw_off(void);
|
void _backlight_hw_off(void);
|
||||||
|
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
#define _backlight_on() _backlight_hw_on()
|
||||||
|
#define _backlight_off() _backlight_hw_off()
|
||||||
|
#else
|
||||||
#define _backlight_on_isr() _backlight_hw_on()
|
#define _backlight_on_isr() _backlight_hw_on()
|
||||||
#define _backlight_off_isr() _backlight_hw_off()
|
#define _backlight_off_isr() _backlight_hw_off()
|
||||||
#define _backlight_on_normal() _backlight_hw_on()
|
#define _backlight_on_normal() _backlight_hw_on()
|
||||||
#define _backlight_off_normal() _backlight_hw_off()
|
#define _backlight_off_normal() _backlight_hw_off()
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -377,9 +377,11 @@ void _buttonlight_on(void)
|
||||||
|
|
||||||
void _buttonlight_off(void)
|
void _buttonlight_off(void)
|
||||||
{
|
{
|
||||||
|
#ifndef BOOTLOADER
|
||||||
if(_buttonlight_timeout>0)
|
if(_buttonlight_timeout>0)
|
||||||
__buttonlight_dim(true);
|
__buttonlight_dim(true);
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
__buttonlight_off();
|
__buttonlight_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void _backlight_on(void)
|
||||||
#ifdef HAVE_LCD_ENABLE
|
#ifdef HAVE_LCD_ENABLE
|
||||||
lcd_enable(true); /* power on lcd */
|
lcd_enable(true); /* power on lcd */
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_SLEEP
|
#if defined(HAVE_LCD_SLEEP) && !defined(BOOTLOADER)
|
||||||
_lcd_sleep_timer = 0; /* LCD should be awake already */
|
_lcd_sleep_timer = 0; /* LCD should be awake already */
|
||||||
#endif
|
#endif
|
||||||
pp_i2c_send(AS3514_I2C_ADDR, DCDC15, backlight_brightness);
|
pp_i2c_send(AS3514_I2C_ADDR, DCDC15, backlight_brightness);
|
||||||
|
@ -53,7 +53,7 @@ void _backlight_off(void)
|
||||||
#ifdef HAVE_LCD_ENABLE
|
#ifdef HAVE_LCD_ENABLE
|
||||||
lcd_enable(false); /* power off lcd */
|
lcd_enable(false); /* power off lcd */
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_SLEEP
|
#if defined(HAVE_LCD_SLEEP) && !defined(BOOTLOADER)
|
||||||
/* Start LCD sleep countdown */
|
/* Start LCD sleep countdown */
|
||||||
if (_lcd_sleep_timeout < 0)
|
if (_lcd_sleep_timeout < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,9 @@ void _backlight_on(void)
|
||||||
{
|
{
|
||||||
int level;
|
int level;
|
||||||
lcd_enable(true);
|
lcd_enable(true);
|
||||||
|
#ifndef BOOTLOADER
|
||||||
_lcd_sleep_timer = 0; /* LCD should be awake already */
|
_lcd_sleep_timer = 0; /* LCD should be awake already */
|
||||||
|
#endif
|
||||||
level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||||
pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
|
pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
|
||||||
set_irq_level(level);
|
set_irq_level(level);
|
||||||
|
@ -48,6 +50,7 @@ void _backlight_off(void)
|
||||||
pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */
|
pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */
|
||||||
set_irq_level(level);
|
set_irq_level(level);
|
||||||
lcd_enable(false);
|
lcd_enable(false);
|
||||||
|
#ifndef BOOTLOADER
|
||||||
/* Start LCD sleep countdown */
|
/* Start LCD sleep countdown */
|
||||||
if (_lcd_sleep_timeout < 0)
|
if (_lcd_sleep_timeout < 0)
|
||||||
{
|
{
|
||||||
|
@ -56,6 +59,7 @@ void _backlight_off(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_lcd_sleep_timer = _lcd_sleep_timeout;
|
_lcd_sleep_timer = _lcd_sleep_timeout;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set brightness by changing the PWM */
|
/* set brightness by changing the PWM */
|
||||||
|
|
|
@ -23,11 +23,16 @@ bool _backlight_init(void); /* Returns backlight current state (true=ON). */
|
||||||
void _backlight_hw_on(void);
|
void _backlight_hw_on(void);
|
||||||
void _backlight_hw_off(void);
|
void _backlight_hw_off(void);
|
||||||
|
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
#define _backlight_on() _backlight_hw_on()
|
||||||
|
#define _backlight_off() _backlight_hw_off()
|
||||||
|
#else
|
||||||
#define _backlight_on_isr() _backlight_hw_on()
|
#define _backlight_on_isr() _backlight_hw_on()
|
||||||
#define _backlight_off_isr() _backlight_hw_off()
|
#define _backlight_off_isr() _backlight_hw_off()
|
||||||
#define _backlight_on_normal() _backlight_hw_on()
|
#define _backlight_on_normal() _backlight_hw_on()
|
||||||
#define _backlight_off_normal() _backlight_hw_off()
|
#define _backlight_off_normal() _backlight_hw_off()
|
||||||
#define _BACKLIGHT_FADE_BOOST
|
#define _BACKLIGHT_FADE_BOOST
|
||||||
|
#endif
|
||||||
|
|
||||||
void _remote_backlight_on(void);
|
void _remote_backlight_on(void);
|
||||||
void _remote_backlight_off(void);
|
void _remote_backlight_off(void);
|
||||||
|
|
|
@ -69,7 +69,7 @@ void power_off(void)
|
||||||
set_irq_level(HIGHEST_IRQ_LEVEL);
|
set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef HAVE_BACKLIGHT
|
||||||
/* Switch off the light on backlight-modded Ondios */
|
/* Switch off the light on backlight-modded Ondios */
|
||||||
__backlight_off();
|
_backlight_off();
|
||||||
#endif
|
#endif
|
||||||
and_b(~0x20, &PBDRL);
|
and_b(~0x20, &PBDRL);
|
||||||
or_b(0x20, &PBIORL);
|
or_b(0x20, &PBIORL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue