forked from len0rd/rockbox
Added option to reduce (and almost prevent) the remote lcd ticking
problem with a cost slightly more CPU usage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7985 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
80ed9ead87
commit
05fdb1ad30
6 changed files with 41 additions and 4 deletions
|
@ -3454,3 +3454,10 @@ desc: Custom themes menu
|
|||
eng: "Browse Themes"
|
||||
voice: "Browse Themes"
|
||||
new:
|
||||
|
||||
id: LANG_REDUCE_TICKING
|
||||
desc: in remote lcd settings menu
|
||||
eng: "Reduce ticking"
|
||||
voice: "Reduce ticking"
|
||||
new:
|
||||
|
||||
|
|
|
@ -277,6 +277,10 @@ 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 */
|
||||
{1, S_O(remote_reduce_ticking), false, "remote reduce ticking", off_on },
|
||||
#endif
|
||||
|
||||
/* new stuff to be added here */
|
||||
/* If values are just added to the end, no need to bump the version. */
|
||||
|
||||
|
|
|
@ -343,6 +343,8 @@ struct user_settings
|
|||
int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
|
||||
1=always,
|
||||
then according to timeout_values[] */
|
||||
bool remote_reduce_ticking; /* 0=normal operation,
|
||||
1=EMI reduce on with cost more CPU. */
|
||||
#endif
|
||||
|
||||
bool next_folder; /* move to next folder */
|
||||
|
|
|
@ -120,6 +120,16 @@ static bool remote_flip_display(void)
|
|||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static bool remote_reduce_ticking(void)
|
||||
{
|
||||
bool rc = set_bool( str(LANG_REDUCE_TICKING),
|
||||
&global_settings.remote_reduce_ticking);
|
||||
|
||||
lcd_remote_emireduce(global_settings.remote_reduce_ticking);
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
|
@ -1540,7 +1550,8 @@ static bool lcd_remote_settings_menu(void)
|
|||
{ ID2P(LANG_CONTRAST), remote_contrast },
|
||||
{ ID2P(LANG_INVERT), remote_invert },
|
||||
{ ID2P(LANG_FLIP_DISPLAY), remote_flip_display },
|
||||
};
|
||||
{ ID2P(LANG_REDUCE_TICKING), remote_reduce_ticking },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
|
|
|
@ -61,7 +61,11 @@
|
|||
#define RS_HI or_l(0x00010000, &GPIO_OUT)
|
||||
|
||||
/* delay loop */
|
||||
#define DELAY do { int _x; for(_x=0;_x<3;_x++);} while (0)
|
||||
#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)
|
||||
|
||||
#define SCROLLABLE_LINES 13
|
||||
|
||||
|
@ -77,6 +81,9 @@ static int curfont = FONT_SYSFIXED;
|
|||
#ifndef SIMULATOR
|
||||
static int xoffset; /* needed for flip */
|
||||
|
||||
/* If set to true, will prevent "ticking" to headphones. */
|
||||
static bool emireduce = false;
|
||||
|
||||
/* remote hotplug */
|
||||
static int countdown; /* for remote plugging debounce */
|
||||
static bool last_remote_status = false;
|
||||
|
@ -343,6 +350,11 @@ int lcd_remote_default_contrast(void)
|
|||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
void lcd_remote_emireduce(bool state)
|
||||
{
|
||||
emireduce = state;
|
||||
}
|
||||
|
||||
void lcd_remote_powersave(bool on)
|
||||
{
|
||||
if (remote_initialized)
|
||||
|
|
|
@ -34,6 +34,7 @@ extern void lcd_remote_backlight_on(void);
|
|||
extern void lcd_remote_backlight_off(void);
|
||||
extern int lcd_remote_default_contrast(void);
|
||||
extern void lcd_remote_set_contrast(int val);
|
||||
extern void lcd_remote_emireduce(bool state);
|
||||
|
||||
extern void lcd_remote_clear_display(void);
|
||||
extern void lcd_remote_puts(int x, int y, const unsigned char *string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue