1
0
Fork 0
forked from len0rd/rockbox

Moved archos backlight code to target tree. Changed old mutlivalue CONFIG_BACKLIGHT to a simple HAVE_BACKLIGHT.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13136 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-04-12 22:12:13 +00:00
parent 734278b7d1
commit 47bf6c5a5a
53 changed files with 256 additions and 152 deletions

View file

@ -1901,7 +1901,7 @@ bool gui_wps_refresh(struct gui_wps *gwps,
display->update(); display->update();
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
if (global_settings.caption_backlight && state->id3) if (global_settings.caption_backlight && state->id3)
{ {
/* turn on backlight n seconds before track ends, and turn it off n /* turn on backlight n seconds before track ends, and turn it off n

View file

@ -38,7 +38,7 @@
#include "lcd-remote.h" #include "lcd-remote.h"
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
{ {
(void)this_item; (void)this_item;
@ -77,7 +77,7 @@ int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
/***********************************/ /***********************************/
/* LCD MENU */ /* LCD MENU */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL);
#if CONFIG_CHARGING #if CONFIG_CHARGING
MENUITEM_SETTING(backlight_timeout_plugged, MENUITEM_SETTING(backlight_timeout_plugged,
@ -102,7 +102,7 @@ MENUITEM_SETTING(lcd_sleep_after_backlight_off,
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
MENUITEM_SETTING(brightness_item, &global_settings.brightness, NULL); MENUITEM_SETTING(brightness_item, &global_settings.brightness, NULL);
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_CONTRAST #ifdef HAVE_LCD_CONTRAST
MENUITEM_SETTING(contrast, &global_settings.contrast, NULL); MENUITEM_SETTING(contrast, &global_settings.contrast, NULL);
#endif #endif
@ -173,7 +173,7 @@ MENUITEM_FUNCTION(reset_colors, 0, ID2P(LANG_RESET_COLORS),
/* now the actual menu */ /* now the actual menu */
MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
NULL, Icon_Display_menu NULL, Icon_Display_menu
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
,&backlight_timeout ,&backlight_timeout
# if CONFIG_CHARGING # if CONFIG_CHARGING
,&backlight_timeout_plugged ,&backlight_timeout_plugged
@ -192,7 +192,7 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
# ifdef HAVE_BACKLIGHT_BRIGHTNESS # ifdef HAVE_BACKLIGHT_BRIGHTNESS
,&brightness_item ,&brightness_item
# endif # endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_CONTRAST #ifdef HAVE_LCD_CONTRAST
,&contrast ,&contrast
#endif #endif

View file

@ -822,7 +822,7 @@ MAKE_MENU(recording_setting_menu, ID2P(LANG_RECORDING_SETTINGS), NULL, Icon_Reco
&filesplitoptionsmenu, &filesplitoptionsmenu,
&rec_prerecord_time, &rec_prerecord_time,
&recdirectory, &recdirectory,
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
&cliplight, &cliplight,
#endif #endif
&rectrigger_item, &rectrigger_item,

View file

@ -3294,7 +3294,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
(actually it should also set the timeout when plugged in, (actually it should also set the timeout when plugged in,
but the function backlight_set_timeout_plugged is not but the function backlight_set_timeout_plugged is not
available in plugins) */ available in plugins) */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
if (rb->global_settings->backlight_timeout > 0) if (rb->global_settings->backlight_timeout > 0)
rb->backlight_set_timeout(1); rb->backlight_set_timeout(1);
#endif #endif
@ -3320,7 +3320,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->ata_spindown(rb->global_settings->disk_spindown); rb->ata_spindown(rb->global_settings->disk_spindown);
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
/* reset backlight settings */ /* reset backlight settings */
rb->backlight_set_timeout(rb->global_settings->backlight_timeout); rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
#endif #endif

View file

@ -1645,7 +1645,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
(actually it should also set the timeout when plugged in, (actually it should also set the timeout when plugged in,
but the function backlight_set_timeout_plugged is not but the function backlight_set_timeout_plugged is not
available in plugins) */ available in plugins) */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
if (rb->global_settings->backlight_timeout > 0) if (rb->global_settings->backlight_timeout > 0)
rb->backlight_set_timeout(1); rb->backlight_set_timeout(1);
#endif #endif
@ -1778,7 +1778,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
save_settings(); /* Save settings (if they have changed) */ save_settings(); /* Save settings (if they have changed) */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
/* reset backlight settings */ /* reset backlight settings */
rb->backlight_set_timeout(rb->global_settings->backlight_timeout); rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
#endif #endif

View file

@ -34,7 +34,7 @@
#include "peakmeter.h" #include "peakmeter.h"
#include "audio.h" #include "audio.h"
#include "screen_access.h" #include "screen_access.h"
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#include "backlight.h" #include "backlight.h"
#endif #endif
#include "action.h" #include "action.h"
@ -1008,7 +1008,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
/* cliplight */ /* cliplight */
if ((pm_clip_left || pm_clip_right) && if ((pm_clip_left || pm_clip_right) &&
global_settings.cliplight && global_settings.cliplight &&
@ -1032,7 +1032,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
} }
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
} }
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
if (trig_status != TRIG_OFF) { if (trig_status != TRIG_OFF) {
int start_trigx, stop_trigx, ycenter; int start_trigx, stop_trigx, ycenter;

View file

@ -699,7 +699,7 @@ void settings_apply(void)
remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold); remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold);
#endif #endif
#endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_REMOTE_LCD */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
backlight_set_timeout(global_settings.backlight_timeout); backlight_set_timeout(global_settings.backlight_timeout);
#if CONFIG_CHARGING #if CONFIG_CHARGING
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
@ -836,7 +836,7 @@ void settings_apply(void)
spdif_power_enable(global_settings.spdif_enable); spdif_power_enable(global_settings.spdif_enable);
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
set_backlight_filter_keypress(global_settings.bl_filter_first_keypress); set_backlight_filter_keypress(global_settings.bl_filter_first_keypress);
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress); set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress);
@ -847,7 +847,7 @@ void settings_apply(void)
#ifdef HAVE_LCD_SLEEP #ifdef HAVE_LCD_SLEEP
lcd_set_sleep_after_backlight_off(global_settings.lcd_sleep_after_backlight_off); lcd_set_sleep_after_backlight_off(global_settings.lcd_sleep_after_backlight_off);
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
/* This should stay last */ /* This should stay last */
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC

View file

@ -626,7 +626,7 @@ struct user_settings
#endif #endif
bool party_mode; /* party mode - unstoppable music */ bool party_mode; /* party mode - unstoppable music */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
bool bl_filter_first_keypress; /* filter first keypress when dark? */ bool bl_filter_first_keypress; /* filter first keypress when dark? */
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */ bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
@ -639,7 +639,7 @@ struct user_settings
int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
has turned off */ has turned off */
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */ unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */

View file

@ -107,7 +107,7 @@ static void rectime_formatter(char *buffer, int buffer_size,
#endif /* HAVE_RECORDING */ #endif /* HAVE_RECORDING */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
static const char backlight_times_conf [] = static const char backlight_times_conf [] =
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
static const int backlight_times[] = static const int backlight_times[] =
@ -405,7 +405,7 @@ const struct settings_list settings[] = {
{ lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING, { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
MAX_CONTRAST_SETTING, 1, NULL, NULL}}}}, MAX_CONTRAST_SETTING, 1, NULL, NULL}}}},
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout, LANG_BACKLIGHT, 6, INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout, LANG_BACKLIGHT, 6,
"backlight timeout", backlight_times_conf, UNIT_SEC, "backlight timeout", backlight_times_conf, UNIT_SEC,
0, 18, 1, backlight_formatter, backlight_getlang, 0, 18, 1, backlight_formatter, backlight_getlang,
@ -417,7 +417,7 @@ const struct settings_list settings[] = {
0, 18, 1, backlight_formatter, backlight_getlang, 0, 18, 1, backlight_formatter, backlight_getlang,
backlight_set_timeout_plugged), backlight_set_timeout_plugged),
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on, BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_set_invert_display), LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_set_invert_display),
@ -512,7 +512,7 @@ const struct settings_list settings[] = {
#endif #endif
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
OFFON_SETTING(0,bl_filter_first_keypress, OFFON_SETTING(0,bl_filter_first_keypress,
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
"backlight filters first keypress", NULL), "backlight filters first keypress", NULL),
@ -521,18 +521,18 @@ const struct settings_list settings[] = {
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
"backlight filters first remote keypress", NULL), "backlight filters first remote keypress", NULL),
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
/** End of old RTC config block **/ /** End of old RTC config block **/
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT, OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT,
false,"caption backlight",NULL), false,"caption backlight",NULL),
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
OFFON_SETTING(0,remote_caption_backlight, LANG_CAPTION_BACKLIGHT, OFFON_SETTING(0,remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
false,"remote caption backlight",NULL), false,"remote caption backlight",NULL),
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
INT_SETTING(0, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING, INT_SETTING(0, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING,
"brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1, "brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
@ -759,7 +759,7 @@ const struct settings_list settings[] = {
UNIT_SEC, 0, 30, 1, rectime_formatter, rectime_getlang, NULL), UNIT_SEC, 0, 30, 1, rectime_formatter, rectime_getlang, NULL),
{F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY, {F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY,
INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED}, INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED},
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
CHOICE_SETTING(0, cliplight, LANG_CLIP_LIGHT, 0 , CHOICE_SETTING(0, cliplight, LANG_CLIP_LIGHT, 0 ,
"cliplight", "off,main,both,remote", NULL, "cliplight", "off,main,both,remote", NULL,
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
@ -974,7 +974,7 @@ const struct settings_list settings[] = {
LANG_WARN_ERASEDYNPLAYLIST_MENU,false, LANG_WARN_ERASEDYNPLAYLIST_MENU,false,
"warn when erasing dynamic playlist",NULL), "warn when erasing dynamic playlist",NULL),
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAS_BUTTON_HOLD #ifdef HAS_BUTTON_HOLD
CHOICE_SETTING(0, backlight_on_button_hold, CHOICE_SETTING(0, backlight_on_button_hold,
LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold", LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold",
@ -991,7 +991,7 @@ const struct settings_list settings[] = {
TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC),
TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC)), TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC)),
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_WM8758 #ifdef HAVE_WM8758
OFFON_SETTING(0,eq_hw_enabled,LANG_EQUALIZER_HARDWARE_ENABLED,false, OFFON_SETTING(0,eq_hw_enabled,LANG_EQUALIZER_HARDWARE_ENABLED,false,

View file

@ -37,7 +37,7 @@
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h" #include "lcd-remote.h"
#endif #endif
#if defined(TARGET_TREE) && !defined(SIMULATOR) #ifndef SIMULATOR
#include "backlight-target.h" #include "backlight-target.h"
#endif #endif
@ -58,39 +58,9 @@ static inline void __backlight_set_brightness(int val)
(void)val; (void)val;
} }
#endif #endif
#else
/* Basic low-level code that simply switches backlight on or off. Probably
* a nice candidate for inclusion in the target/ dir. */
#ifndef TARGET_TREE
static inline void __backlight_on(void)
{
#if CONFIG_BACKLIGHT == BL_RTC
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH);
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
or_b(0x40, &PADRH); /* drive it high */
#endif
}
static inline void __backlight_off(void)
{
#if CONFIG_BACKLIGHT == BL_RTC
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
and_b(~0x40, &PAIORH); /* let it float (up) */
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
and_b(~0x40, &PADRH); /* drive it low */
#endif
}
#endif
#endif /* SIMULATOR */ #endif /* SIMULATOR */
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER) #if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
const signed char backlight_timeout_value[19] = const signed char backlight_timeout_value[19] =
{ {
@ -558,23 +528,15 @@ void backlight_init(void)
queue_init(&backlight_queue, true); queue_init(&backlight_queue, true);
queue_set_irq_safe(&backlight_queue, true); queue_set_irq_safe(&backlight_queue, true);
#ifdef SIMULATOR #ifndef SIMULATOR
/* do nothing */
#elif defined(__BACKLIGHT_INIT)
/* Remove the __BACKLIGHT_INIT references when __backlight_init is
available on all backlighted targets. Take them out of the
backlight-target.h files as well */
if (__backlight_init()) if (__backlight_init())
{ {
# if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) # ifdef HAVE_BACKLIGHT_PWM_FADING
/* If backlight is already on, don't fade in. */ /* If backlight is already on, don't fade in. */
bl_dim_current = BL_PWM_COUNT; bl_dim_current = BL_PWM_COUNT;
bl_dim_target = BL_PWM_COUNT; bl_dim_target = BL_PWM_COUNT;
# endif # endif
} }
#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
or_b(0x40, &PAIORH); /* ..and output */
#endif #endif
backlight_on(); backlight_on();
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
@ -806,16 +768,14 @@ void backlight_set_brightness(int val)
} }
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */ #endif /* HAVE_BACKLIGHT_BRIGHTNESS */
#else /* (CONFIG_BACKLIGHT == 0) || defined(BOOTLOADER) #else /* !defined(HAVE_BACKLIGHT) || defined(BOOTLOADER)
-- no backlight, empty dummy functions */ -- no backlight, empty dummy functions */
#if defined(BOOTLOADER) && CONFIG_BACKLIGHT #if defined(BOOTLOADER) && defined(HAVE_BACKLIGHT)
void backlight_init(void) void backlight_init(void)
{ {
#ifdef __BACKLIGHT_INIT
__backlight_init(); __backlight_init();
__backlight_on(); __backlight_on();
#endif
} }
#endif #endif
@ -832,4 +792,4 @@ bool is_remote_backlight_on(void) {return true;}
#ifdef HAVE_BACKLIGHT_BRIGHTNESS #ifdef HAVE_BACKLIGHT_BRIGHTNESS
void backlight_set_brightness(int val) { (void)val; } void backlight_set_brightness(int val) { (void)val; }
#endif #endif
#endif /* CONFIG_BACKLIGHT && !defined(BOOTLOADER) */ #endif /* defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER) */

View file

@ -52,12 +52,12 @@ static long last_read; /* Last button status, for debouncing/filtering */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
static bool flipped; /* buttons can be flipped to match the LCD flip */ static bool flipped; /* buttons can be flipped to match the LCD flip */
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
static bool filter_first_keypress; static bool filter_first_keypress;
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
static bool remote_filter_first_keypress; static bool remote_filter_first_keypress;
#endif #endif
#endif /* CONFIG_BACKLIGHT */ #endif /* HAVE_BACKLIGHT */
#ifdef HAVE_HEADPHONE_DETECTION #ifdef HAVE_HEADPHONE_DETECTION
bool phones_present = false; bool phones_present = false;
#endif #endif
@ -80,7 +80,7 @@ static void button_tick(void)
static int repeat_count = 0; static int repeat_count = 0;
static bool repeat = false; static bool repeat = false;
static bool post = false; static bool post = false;
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
static bool skip_release = false; static bool skip_release = false;
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
static bool skip_remote_release = false; static bool skip_remote_release = false;
@ -121,7 +121,7 @@ static void button_tick(void)
diff = btn ^ lastbtn; diff = btn ^ lastbtn;
if(diff && (btn & diff) == 0) if(diff && (btn & diff) == 0)
{ {
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
if(diff & BUTTON_REMOTE) if(diff & BUTTON_REMOTE)
if(!skip_remote_release) if(!skip_remote_release)
@ -211,7 +211,7 @@ static void button_tick(void)
if (queue_empty(&button_queue)) if (queue_empty(&button_queue))
{ {
queue_post(&button_queue, BUTTON_REPEAT | btn, 0); queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
skip_remote_release = false; skip_remote_release = false;
#endif #endif
@ -222,7 +222,7 @@ static void button_tick(void)
} }
else else
{ {
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
if (btn & BUTTON_REMOTE) { if (btn & BUTTON_REMOTE) {
if (!remote_filter_first_keypress || is_remote_backlight_on() if (!remote_filter_first_keypress || is_remote_backlight_on()
@ -347,7 +347,7 @@ void button_init(void)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
flipped = false; flipped = false;
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
filter_first_keypress = false; filter_first_keypress = false;
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
remote_filter_first_keypress = false; remote_filter_first_keypress = false;
@ -419,7 +419,7 @@ void button_set_flip(bool flip)
} }
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
void set_backlight_filter_keypress(bool value) void set_backlight_filter_keypress(bool value)
{ {
filter_first_keypress = value; filter_first_keypress = value;

View file

@ -26,7 +26,7 @@ void backlight_on(void);
void backlight_off(void); void backlight_off(void);
void backlight_set_timeout(int index); void backlight_set_timeout(int index);
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
void backlight_init(void); void backlight_init(void);
#if defined(IAUDIO_X5) && !defined(SIMULATOR) #if defined(IAUDIO_X5) && !defined(SIMULATOR)
@ -54,9 +54,9 @@ void lcd_set_sleep_after_backlight_off(int index);
extern const signed char lcd_sleep_timeout_value[]; extern const signed char lcd_sleep_timeout_value[];
#endif #endif
#else /* CONFIG_BACKLIGHT == 0 */ #else /* !HAVE_BACKLIGHT */
#define backlight_init() #define backlight_init()
#endif /* CONFIG_BACKLIGHT */ #endif /* !HAVE_BACKLIGHT */
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
void remote_backlight_on(void); void remote_backlight_on(void);

View file

@ -33,7 +33,7 @@ void button_clear_queue(void);
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
void button_set_flip(bool flip); /* turn 180 degrees */ void button_set_flip(bool flip); /* turn 180 degrees */
#endif #endif
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
void set_backlight_filter_keypress(bool value); void set_backlight_filter_keypress(bool value);
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
void set_remote_backlight_filter_keypress(bool value); void set_remote_backlight_filter_keypress(bool value);

View file

@ -69,8 +69,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */ #define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary #define HAVE_BACKLIGHT
because of 'target' stuff */
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */

View file

@ -52,7 +52,7 @@
#define HAVE_SPDIF_IN #define HAVE_SPDIF_IN
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ #define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC #define CONFIG_I2C I2C_PLAYREC

View file

@ -42,7 +42,7 @@
#define CONFIG_RTC RTC_S3C2440 #define CONFIG_RTC RTC_S3C2440
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_GIGABEAT /* port controlled PWM */ #define HAVE_BACKLIGHT
#define HAVE_LCD_ENABLE #define HAVE_LCD_ENABLE

View file

@ -78,8 +78,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */ #define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary #define HAVE_BACKLIGHT
because of 'target' stuff */
#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */

View file

@ -56,7 +56,7 @@
#define CONFIG_LCD LCD_S1D15E06 #define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ #define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */ /* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING #define HAVE_BACKLIGHT_PWM_FADING

View file

@ -72,8 +72,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */ #define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary #define HAVE_BACKLIGHT
because of target tree stuff */
#define BATTERY_CAPACITY_DEFAULT 820 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 820 /* default battery capacity */

View file

@ -51,7 +51,7 @@
#define CONFIG_LCD LCD_S1D15E06 #define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ #define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */ /* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING #define HAVE_BACKLIGHT_PWM_FADING

View file

@ -51,7 +51,7 @@
#define HAVE_REMOTE_LCD #define HAVE_REMOTE_LCD
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H300 /* port controlled PWM */ #define HAVE_BACKLIGHT
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -64,7 +64,7 @@
#define CONFIG_LCD LCD_S1D15E06 #define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_M5 /* PCF50606 I2C */ #define HAVE_BACKLIGHT
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -66,7 +66,7 @@
#define CONFIG_LCD LCD_X5 #define CONFIG_LCD LCD_X5
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_X5 /* PCF50606 I2C */ #define HAVE_BACKLIGHT
#define HAVE_BACKLIGHT_BRIGHTNESS #define HAVE_BACKLIGHT_BRIGHTNESS
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */

View file

@ -77,7 +77,7 @@
#define ROM_START 0x00000000 #define ROM_START 0x00000000
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_IFP7XX /* port controlled */ #define HAVE_BACKLIGHT
/* Define this to the CPU frequency */ /* Define this to the CPU frequency */
#define CPU_FREQ 48000000 #define CPU_FREQ 48000000

View file

@ -64,7 +64,7 @@
#define HAVE_SW_TONE_CONTROLS #define HAVE_SW_TONE_CONTROLS
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD3G /* port controlled */ #define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */

View file

@ -70,7 +70,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */ #define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */ #define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */

View file

@ -67,7 +67,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODMINI /* port controlled */ #define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */

View file

@ -67,7 +67,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODMINI /* port controlled */ #define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */ /* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING #define HAVE_BACKLIGHT_PWM_FADING

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODNANO /* port controlled */ #define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */ /* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING #define HAVE_BACKLIGHT_PWM_FADING

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODNANO /* port controlled */ #define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */ /* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING #define HAVE_BACKLIGHT_PWM_FADING

View file

@ -40,7 +40,7 @@
#define CONFIG_CODEC MAS3587F #define CONFIG_CODEC MAS3587F
/* Enable this if you have done the backlight mod */ /* Enable this if you have done the backlight mod */
//#define CONFIG_BACKLIGHT BL_PA14_HI //#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */

View file

@ -33,7 +33,7 @@
#define CONFIG_CODEC MAS3539F #define CONFIG_CODEC MAS3539F
/* Enable this if you have done the backlight mod */ /* Enable this if you have done the backlight mod */
//#define CONFIG_BACKLIGHT BL_PA14_HI //#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */

View file

@ -25,7 +25,7 @@
#define HAVE_DAC3550A #define HAVE_DAC3550A
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */ #define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */ #define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */

View file

@ -46,7 +46,7 @@
#define HAVE_SPDIF_IN #define HAVE_SPDIF_IN
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ #define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC #define CONFIG_I2C I2C_PLAYREC

View file

@ -49,7 +49,7 @@
#define HAVE_SPDIF_IN #define HAVE_SPDIF_IN
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */ #define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC #define CONFIG_I2C I2C_PLAYREC

View file

@ -55,8 +55,7 @@
#define AB_REPEAT_ENABLE 1 #define AB_REPEAT_ENABLE 1
/* Define this for LCD backlight available */ /* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_TPJ1022 /* TODO: figure this out, probably not necessary #define HAVE_BACKLIGHT
because of 'target' stuff */
#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity
TODO: check this, probably different TODO: check this, probably different

View file

@ -113,24 +113,6 @@
#define RGB565 565 #define RGB565 565
#define RGB565SWAPPED 3553 #define RGB565SWAPPED 3553
/* CONFIG_BACKLIGHT */
#define BL_PA14_LO 1 /* Player, PA14 low active */
#define BL_RTC 2 /* Recorder, RTC square wave output */
#define BL_PA14_HI 3 /* Ondio, PA14 high active */
#define BL_IRIVER_H100 4 /* IRiver GPIO */
#define BL_IPOD4G 5 /* Apple iPod 4G */
#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/
#define BL_IPOD3G 7 /* Apple iPod 3g with dock */
#define BL_IRIVER_H300 8 /* IRiver PWM */
#define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */
#define BL_IPODMINI 10 /* Apple iPod Mini */
#define BL_GIGABEAT 11 /* Toshiba Gigabeat */
#define BL_H10 12 /* iriver H10 */
#define BL_X5 13 /* iAudio X5 PCF50606 I2C */
#define BL_H10_5GB 14 /* iriver H10 5/6GB */
#define BL_TPJ1022 15 /* Tatung Elio TPJ-1022 */
#define BL_M5 16 /* iAudio M5 PCF50606 I2C */
/* CONFIG_I2C */ /* CONFIG_I2C */
#define I2C_PLAYREC 1 /* Archos Player/Recorder style */ #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
#define I2C_ONDIO 2 /* Ondio style */ #define I2C_ONDIO 2 /* Ondio style */
@ -235,10 +217,6 @@
#define CONFIG_LED 0 #define CONFIG_LED 0
#endif #endif
#ifndef CONFIG_BACKLIGHT
#define CONFIG_BACKLIGHT 0
#endif
#ifndef CONFIG_CHARGING #ifndef CONFIG_CHARGING
#define CONFIG_CHARGING 0 #define CONFIG_CHARGING 0
#endif #endif

View file

@ -708,7 +708,7 @@ static int runcurrent(void)
current = CURRENT_USB; current = CURRENT_USB;
} }
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER) #if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
if (backlight_get_current_timeout() == 0) /* LED always on */ if (backlight_get_current_timeout() == 0) /* LED always on */
current += CURRENT_BACKLIGHT; current += CURRENT_BACKLIGHT;
#endif #endif

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);
void __backlight_set_brightness(int brightness); void __backlight_set_brightness(int brightness);

View file

@ -22,6 +22,7 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void); bool __backlight_init(void);
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void); bool __backlight_init(void);
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H #ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H #define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void); /* Returns backlight current state (true=ON). */ bool __backlight_init(void); /* Returns backlight current state (true=ON). */
void __backlight_on(void); void __backlight_on(void);
void __backlight_off(void); void __backlight_off(void);

View file

@ -0,0 +1,39 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "rtc.h"
#define __backlight_init() true
static inline void __backlight_on(void)
{
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
}
static inline void __backlight_off(void)
{
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
}
#endif

View file

@ -0,0 +1,47 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "cpu.h"
#ifdef HAVE_BACKLIGHT
/* A stock Ondio has no backlight, it needs a hardware mod. */
static inline bool __backlight_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
or_b(0x40, &PADRH); /* drive it high */
or_b(0x40, &PAIORH); /* ..and output */
return true;
}
static inline void __backlight_on(void)
{
or_b(0x40, &PADRH); /* drive it high */
}
static inline void __backlight_off(void)
{
and_b(~0x40, &PADRH); /* drive it low */
}
#endif /* HAVE_BACKLIGHT */
#endif

View file

@ -0,0 +1,44 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "cpu.h"
static inline bool __backlight_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH); /* ..and output */
return true;
}
static inline void __backlight_on(void)
{
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH);
}
static inline void __backlight_off(void)
{
and_b(~0x40, &PAIORH); /* let it float (up) */
}
#endif

View file

@ -0,0 +1,39 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "rtc.h"
#define __backlight_init() true
static inline void __backlight_on(void)
{
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
}
static inline void __backlight_off(void)
{
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
}
#endif

View file

@ -49,7 +49,7 @@ struct event_queue button_queue;
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
static bool filter_first_keypress; static bool filter_first_keypress;
void set_backlight_filter_keypress(bool value) void set_backlight_filter_keypress(bool value)
@ -90,7 +90,7 @@ void button_event(int key, bool pressed)
static int repeat_count = 0; static int repeat_count = 0;
static bool repeat = false; static bool repeat = false;
static bool post = false; static bool post = false;
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
static bool skip_release = false; static bool skip_release = false;
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
static bool skip_remote_release = false; static bool skip_remote_release = false;
@ -568,7 +568,7 @@ void button_event(int key, bool pressed)
diff = btn ^ lastbtn; diff = btn ^ lastbtn;
if(diff && (btn & diff) == 0) if(diff && (btn & diff) == 0)
{ {
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
if(diff & BUTTON_REMOTE) if(diff & BUTTON_REMOTE)
if(!skip_remote_release) if(!skip_remote_release)
@ -635,7 +635,7 @@ void button_event(int key, bool pressed)
if (queue_empty(&button_queue)) if (queue_empty(&button_queue))
{ {
queue_post(&button_queue, BUTTON_REPEAT | btn, 0); queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
if(btn & BUTTON_REMOTE) if(btn & BUTTON_REMOTE)
{ {
@ -652,7 +652,7 @@ void button_event(int key, bool pressed)
} }
else else
{ {
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
if (btn & BUTTON_REMOTE) { if (btn & BUTTON_REMOTE) {
if (!remote_filter_first_keypress || is_remote_backlight_on()) if (!remote_filter_first_keypress || is_remote_backlight_on())

View file

@ -25,7 +25,7 @@ SDL_Surface* lcd_surface;
int lcd_backlight_val; int lcd_backlight_val;
#if LCD_DEPTH <= 8 #if LCD_DEPTH <= 8
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
#endif #endif
SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
@ -71,7 +71,7 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
} }
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
void sim_backlight(int value) void sim_backlight(int value)
{ {
lcd_backlight_val = value; lcd_backlight_val = value;
@ -116,7 +116,7 @@ void sim_lcd_init(void)
#endif #endif
#if LCD_DEPTH <= 8 #if LCD_DEPTH <= 8
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
0, (1<<LCD_DEPTH)); 0, (1<<LCD_DEPTH));
#else #else
@ -132,7 +132,7 @@ void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int))
lcd_ex_shades = shades; lcd_ex_shades = shades;
lcd_ex_getpixel = getpixel; lcd_ex_getpixel = getpixel;
if (shades) { if (shades) {
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
if (lcd_backlight_val > 0) { if (lcd_backlight_val > 0) {
sdl_set_gradient(lcd_surface, &lcd_color_max, sdl_set_gradient(lcd_surface, &lcd_color_max,
&lcd_backlight_color_zero, (1<<LCD_DEPTH), &lcd_backlight_color_zero, (1<<LCD_DEPTH),

View file

@ -71,7 +71,7 @@ void lcd_update(void)
LCD_HEIGHT*CHAR_HEIGHT*CHAR_PIXEL); LCD_HEIGHT*CHAR_HEIGHT*CHAR_PIXEL);
} }
#if CONFIG_BACKLIGHT #ifdef HAVE_BACKLIGHT
void sim_backlight(int value) void sim_backlight(int value)
{ {
if (value > 0) { if (value > 0) {