1
0
Fork 0
forked from len0rd/rockbox

Accepted FS #5772 by Michael Sevakis

1. X5 lcd sleep
2. #define HAVE_LCD_ENABLE
3. add "backlight (on hold switch)" setting, adapted from FS #5735

Note that the while(1) yield ==> asm("halt") part is NOT commited here,
I prefer it would be discussed separately.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10489 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rani Hod 2006-08-08 22:03:56 +00:00
parent f8866a3a9c
commit c9f59e6f75
17 changed files with 644 additions and 211 deletions

View file

@ -844,21 +844,15 @@ static int button_read(void)
static bool remote_hold_button = false;
static int prev_data = 0xff;
static int last_valid = 0xff;
/* light handling */
if (hold_button && !button_hold())
{
backlight_on();
}
if (remote_hold_button && !remote_button_hold_only())
{
remote_backlight_on();
}
hold_button = button_hold();
remote_hold_button = remote_button_hold_only();
bool hold_button_old;
/* normal buttons */
hold_button_old = hold_button;
hold_button = button_hold();
if (hold_button != hold_button_old)
backlight_hold_changed(hold_button);
if (!hold_button)
{
data = adc_scan(ADC_BUTTONS);
@ -920,6 +914,13 @@ static int button_read(void)
}
/* remote buttons */
remote_hold_button = remote_button_hold_only();
if (remote_hold_button && !remote_button_hold_only())
{
remote_backlight_on();
}
if (!remote_hold_button)
{
data = adc_scan(ADC_REMOTE);
@ -1038,15 +1039,15 @@ static int button_read(void)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
static bool hold_button = false;
/* light handling */
if (hold_button && !button_hold())
{
backlight_on();
}
hold_button = button_hold();
bool hold_button_old;
/* normal buttons */
hold_button_old = hold_button;
hold_button = button_hold();
if (hold_button != hold_button_old)
backlight_hold_changed(hold_button);
if (!button_hold())
{
data = adc_read(ADC_BUTTONS);
@ -1217,28 +1218,30 @@ static int button_read(void)
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
static bool hold_button = false;
bool hold_button_old;
/* light handling */
if (hold_button && !button_hold())
{
backlight_on();
}
/* normal buttons */
hold_button_old = hold_button;
hold_button = button_hold();
if (hold_button != hold_button_old)
backlight_hold_changed(hold_button);
(void)data;
/* The int_btn variable is set in the button interrupt handler */
btn = int_btn;
#elif (CONFIG_KEYPAD == IPOD_3G_PAD)
static bool hold_button = false;
bool hold_button_old;
/* light handling */
if (hold_button && !button_hold())
{
backlight_on();
}
/* normal buttons */
hold_button_old = hold_button;
hold_button = button_hold();
if (hold_button != hold_button_old)
backlight_hold_changed(hold_button);
(void)data;
btn = ipod_3g_button_read();