diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-19 07:58:20 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-19 07:58:20 +0000 |
| commit | 05fdb1ad30bbeeabe3cb74f4f5d366a53c8f3cef (patch) | |
| tree | 83081b5d7b933b118a4672b4cf0c4750220ed69b /firmware/drivers | |
| parent | 80ed9ead8748f2f569b35a7af1f9487990b10c42 (diff) | |
| download | rockbox-05fdb1ad30bbeeabe3cb74f4f5d366a53c8f3cef.zip rockbox-05fdb1ad30bbeeabe3cb74f4f5d366a53c8f3cef.tar.gz rockbox-05fdb1ad30bbeeabe3cb74f4f5d366a53c8f3cef.tar.bz2 rockbox-05fdb1ad30bbeeabe3cb74f4f5d366a53c8f3cef.tar.xz | |
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
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index aaf8a1e..221338b 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -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; @@ -177,7 +184,7 @@ void lcd_remote_write_data(const unsigned char* p_bytes, int count) CLK_HI; data <<= 1; DELAY; - + CLK_LO; } } @@ -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) @@ -476,7 +488,7 @@ static void remote_tick(void) } } } -} +} #endif /* !SIMULATOR */ /* LCD init */ |