summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2005-04-15 12:08:49 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2005-04-15 12:08:49 +0000
commit7c1879bdd0d79cfbe131fb2ffb3eb14025747567 (patch)
treed6dc3aac81c19efec04644bf5734d706ab35dc1e
parenta6a01903e6d31f16cffd3b2d7d36c43403bdbcb7 (diff)
downloadrockbox-7c1879bdd0d79cfbe131fb2ffb3eb14025747567.tar.gz
rockbox-7c1879bdd0d79cfbe131fb2ffb3eb14025747567.tar.bz2
rockbox-7c1879bdd0d79cfbe131fb2ffb3eb14025747567.zip
IRiver: (1)Setting some remote lcd settings via menu (2) added driver to main.c (3) updated english.lang
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6291 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang6
-rw-r--r--apps/main.c8
-rw-r--r--apps/settings.c14
-rw-r--r--apps/settings.h11
-rw-r--r--apps/settings_menu.c48
-rw-r--r--firmware/drivers/lcd-h100-remote.c17
6 files changed, 99 insertions, 5 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index ba35a7026d..bc688a3115 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3069,3 +3069,9 @@ new:
id: LANG_RECORD_TRIGGER_ACTIVE
eng: "Trigger active"
new:
+
+id: LANG_LCD_REMOTE_MENU
+desc: in the display sub menu
+eng: "Remote-LCD Settings"
+voice: ""
+new: \ No newline at end of file
diff --git a/apps/main.c b/apps/main.c
index af84a46984..25bc9296e5 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -71,6 +71,10 @@
#include "ata_mmc.h"
#endif
+#ifdef HAVE_REMOTE_LCD
+#include "lcd-remote.h"
+#endif
+
/*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */
const char appsversion[]=APPSVERSION;
@@ -139,6 +143,10 @@ void init(void)
settings_reset();
lcd_init();
+
+#ifdef HAVE_REMOTE_LCD
+ lcd_remote_init();
+#endif
font_init();
show_logo();
diff --git a/apps/settings.c b/apps/settings.c
index bbfdd54d93..904c4aca13 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -83,6 +83,10 @@ const char rec_base_directory[] = REC_BASE_DIR;
#define MAX_LINES 2
#endif
+#ifdef HAVE_REMOTE_LCD
+#include "lcd-remote.h"
+#endif
+
long lasttime = 0;
static long config_sector = 0; /* mark uninitialized */
static unsigned char config_block[CONFIG_BLOCK_SIZE];
@@ -244,6 +248,12 @@ static const struct bit_entry rtc_bits[] =
{1, S_O(battery_type), 0, "battery type", "alkaline,nimh" },
#endif
+#ifdef HAVE_REMOTE_LCD
+ /* remote lcd */
+ {6, S_O(remote_contrast), 32, "remote_contrast", NULL },
+ {1, S_O(remote_invert), false, "remote_invert", off_on },
+#endif
+
/* Current sum of bits: 259 (worst case) */
/* Sum of all bit sizes must not grow beyond 288! */
};
@@ -763,6 +773,10 @@ void settings_apply(void)
lcd_set_contrast(global_settings.contrast);
lcd_scroll_speed(global_settings.scroll_speed);
+#ifdef HAVE_REMOTE_LCD
+ lcd_remote_set_contrast(global_settings.remote_contrast);
+ lcd_remote_set_invert_display(global_settings.remote_invert);
+#endif
backlight_set_timeout(global_settings.backlight_timeout);
backlight_set_on_when_charging(global_settings.backlight_on_when_charging);
ata_spindown(global_settings.disk_spindown);
diff --git a/apps/settings.h b/apps/settings.h
index a76db9f143..853dc41628 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -301,6 +301,17 @@ struct user_settings
/* file browser sorting */
int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
int sort_dir; /* 0=alpha, 1=date (old first), 2=date (new first) */
+
+#ifdef HAVE_REMOTE_LCD
+ /* remote lcd */
+ int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
+ bool remote_invert; /* invert display */
+ bool remote_flip_display; /* turn display (and button layout) by 180 degrees */
+ int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
+ 1=always,
+ then according to timeout_values[] */
+#endif
+
};
enum optiontype { INT, BOOL };
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 5af7470c7d..2ece3a0ac7 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -56,6 +56,10 @@ void dac_line_in(bool enable);
#include "alarm_menu.h"
#endif
+#ifdef HAVE_REMOTE_LCD
+#include "lcd-remote.h"
+#endif
+
#ifdef HAVE_CHARGING
static bool car_adapter_mode(void)
{
@@ -75,6 +79,26 @@ static bool contrast(void)
MAX_CONTRAST_SETTING );
}
+#ifdef HAVE_REMOTE_LCD
+static bool remote_contrast(void)
+{
+ return set_int( str(LANG_CONTRAST), "", UNIT_INT,
+ &global_settings.remote_contrast,
+ lcd_remote_set_contrast, 1, MIN_CONTRAST_SETTING,
+ MAX_CONTRAST_SETTING );
+}
+
+static bool remote_invert(void)
+{
+ bool rc = set_bool_options(str(LANG_INVERT),
+ &global_settings.remote_invert,
+ STR(LANG_INVERT_LCD_INVERSE),
+ STR(LANG_INVERT_LCD_NORMAL),
+ lcd_remote_set_invert_display);
+ return rc;
+}
+#endif
+
#ifdef CONFIG_BACKLIGHT
static bool caption_backlight(void)
{
@@ -1178,6 +1202,27 @@ static bool lcd_settings_menu(void)
return result;
}
+#ifdef HAVE_REMOTE_LCD
+static bool lcd_remote_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ static const struct menu_item items[] = {
+ { ID2P(LANG_CONTRAST), remote_contrast },
+ { ID2P(LANG_INVERT), remote_invert },
+/* { ID2P(LANG_FLIP_DISPLAY), remote_flip_display },
+ { ID2P(LANG_INVERT_CURSOR), invert_cursor },*/
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
+ NULL, NULL, NULL);
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+#endif
+
#ifdef HAVE_LCD_BITMAP
static bool bars_settings_menu(void)
{
@@ -1214,6 +1259,9 @@ static bool display_settings_menu(void)
#endif
{ ID2P(LANG_WHILE_PLAYING), custom_wps_browse },
{ ID2P(LANG_LCD_MENU), lcd_settings_menu },
+#ifdef HAVE_REMOTE_LCD
+ { ID2P(LANG_LCD_REMOTE_MENU), lcd_remote_settings_menu },
+#endif
{ ID2P(LANG_SCROLL_MENU), scroll_settings_menu },
#ifdef HAVE_LCD_BITMAP
{ ID2P(LANG_BARS_MENU), bars_settings_menu },
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 2eb99ddc88..f214838c7e 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -29,7 +29,11 @@
#include "system.h"
#include "font.h"
-unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
+unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]
+#ifndef SIMULATOR
+ __attribute__ ((section(".idata")))
+#endif
+ ;
#define CS_LO GPIO1_OUT &= ~0x00000004
#define CS_HI GPIO1_OUT |= 0x00000004
@@ -176,6 +180,11 @@ void lcd_remote_set_invert_display(bool yesno)
lcd_remote_write_command(LCD_REMOTE_CNTL_REVERSE_ON_OFF | yesno);
}
+int lcd_remote_default_contrast(void)
+{
+ return 32;
+}
+
void lcd_remote_bitmap(const unsigned char *src, int x, int y, int nx, int ny, bool clear) __attribute__ ((section (".icode")));
void lcd_remote_bitmap(const unsigned char *src, int x, int y, int nx, int ny, bool clear)
{
@@ -317,7 +326,7 @@ void lcd_remote_drawrect(int x, int y, int nx, int ny)
}
}
-void lcd_remote_clear(void)
+void lcd_remote_clear_display(void)
{
memset(lcd_remote_framebuffer, 0, sizeof lcd_remote_framebuffer);
}
@@ -360,7 +369,6 @@ void lcd_remote_init(void)
lcd_remote_write_command(LCD_REMOTE_CNTL_POWER_CONTROL | 0x7);
lcd_remote_write_command(LCD_REMOTE_CNTL_SELECT_REGULATOR | 0x4); // 0x4 Select regulator @ 5.0 (default);
- lcd_remote_set_contrast(32);
sleep(1);
@@ -370,7 +378,6 @@ void lcd_remote_init(void)
lcd_remote_write_command(LCD_REMOTE_CNTL_DISPLAY_ON_OFF | 1);
- lcd_remote_clear();
- lcd_remote_drawrect(0, 0, 10, 20);
+ lcd_remote_clear_display();
lcd_remote_update();
}