From 93d8ca53c3b6dd0602b31131da0a6f814ec73ca0 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sat, 19 Nov 2005 09:26:02 +0000 Subject: [PATCH] Fixed the simulator builds and added HAVE_REMOTE_LCD_TICKING define. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7987 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 4 +++- apps/settings.h | 2 ++ apps/settings_menu.c | 4 ++++ firmware/drivers/lcd-h100-remote.c | 8 ++++++++ firmware/export/config-h100.h | 3 +++ firmware/export/config-h120.h | 3 +++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/settings.c b/apps/settings.c index 612c7662f6..0bbdeaad69 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -277,7 +277,7 @@ static const struct bit_entry rtc_bits[] = {1, S_O(bidi_support), false, "bidi hebrew/arabic", off_on }, #endif -#ifdef HAVE_REMOTE_LCD /* move to REMOTE_LCD next time we bump version */ +#ifdef HAVE_REMOTE_LCD_TICKING /* move to REMOTE_LCD next time we bump version */ {1, S_O(remote_reduce_ticking), false, "remote reduce ticking", off_on }, #endif @@ -854,7 +854,9 @@ void settings_apply(void) lcd_remote_set_contrast(global_settings.remote_contrast); lcd_remote_set_invert_display(global_settings.remote_invert); lcd_remote_set_flip(global_settings.remote_flip_display); +#ifdef HAVE_REMOTE_LCD_TICKING lcd_remote_emireduce(global_settings.remote_reduce_ticking); +#endif remote_backlight_set_timeout(global_settings.remote_backlight_timeout); #endif backlight_set_timeout(global_settings.backlight_timeout); diff --git a/apps/settings.h b/apps/settings.h index 0dd9789991..a4401f8ae5 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -343,8 +343,10 @@ struct user_settings int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never, 1=always, then according to timeout_values[] */ +#ifdef HAVE_REMOTE_LCD_TICKING bool remote_reduce_ticking; /* 0=normal operation, 1=EMI reduce on with cost more CPU. */ +#endif #endif bool next_folder; /* move to next folder */ diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 05fcacf77a..fc54436afb 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -121,6 +121,7 @@ static bool remote_flip_display(void) return rc; } +#ifdef HAVE_REMOTE_LCD_TICKING static bool remote_reduce_ticking(void) { bool rc = set_bool( str(LANG_REDUCE_TICKING), @@ -131,6 +132,7 @@ static bool remote_reduce_ticking(void) return rc; } #endif +#endif #ifdef CONFIG_BACKLIGHT static bool caption_backlight(void) @@ -1550,7 +1552,9 @@ static bool lcd_remote_settings_menu(void) { ID2P(LANG_CONTRAST), remote_contrast }, { ID2P(LANG_INVERT), remote_invert }, { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, +#ifdef HAVE_REMOTE_LCD_TICKING { ID2P(LANG_REDUCE_TICKING), remote_reduce_ticking }, +#endif }; m=menu_init( items, sizeof(items) / sizeof(*items), NULL, diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index 221338b2d9..02a907dc89 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -61,11 +61,15 @@ #define RS_HI or_l(0x00010000, &GPIO_OUT) /* delay loop */ +#ifdef HAVE_REMOTE_LCD_TICKING #define DELAY_DEFAULT do { int _x = 0; for (_x = 0;_x < 2;_x++); } while (0) #define DELAY_EMIREDUCE do { int _x = cpu_frequency >> 21; while (_x--); } \ while (0) #define DELAY do { if (emireduce) DELAY_EMIREDUCE; \ else DELAY_DEFAULT; } while (0) +#else +#define DELAY do { int _x = 0; for (_x = 0;_x < 3;_x++); } while (0) +#endif #define SCROLLABLE_LINES 13 @@ -81,8 +85,10 @@ static int curfont = FONT_SYSFIXED; #ifndef SIMULATOR static int xoffset; /* needed for flip */ +#ifdef HAVE_REMOTE_LCD_TICKING /* If set to true, will prevent "ticking" to headphones. */ static bool emireduce = false; +#endif /* remote hotplug */ static int countdown; /* for remote plugging debounce */ @@ -350,10 +356,12 @@ int lcd_remote_default_contrast(void) #ifndef SIMULATOR +#ifdef HAVE_REMOTE_LCD_TICKING void lcd_remote_emireduce(bool state) { emireduce = state; } +#endif void lcd_remote_powersave(bool on) { diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 35b35e0f27..b9336a7e75 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -35,6 +35,9 @@ /* Define this if you have an remote lcd */ #define HAVE_REMOTE_LCD +#ifndef SIMULATOR +#define HAVE_REMOTE_LCD_TICKING +#endif #define CONFIG_LCD LCD_S1D15E06 diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index e6c829a2a5..dc5e924d06 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -33,6 +33,9 @@ /* Define this if you have an remote lcd */ #define HAVE_REMOTE_LCD +#ifndef SIMULATOR +#define HAVE_REMOTE_LCD_TICKING +#endif #define CONFIG_LCD LCD_S1D15E06