diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2003-07-09 23:07:49 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2003-07-09 23:07:49 +0000 |
| commit | 067262dbf09d63fb645d1c2e67d225325b6854c9 (patch) | |
| tree | b971492d0c80a496e596226a952ffe222f2c468b /firmware/drivers | |
| parent | 0ef911d43c364fe535111c59abab54e10dc06ce1 (diff) | |
| download | rockbox-067262dbf09d63fb645d1c2e67d225325b6854c9.zip rockbox-067262dbf09d63fb645d1c2e67d225325b6854c9.tar.gz rockbox-067262dbf09d63fb645d1c2e67d225325b6854c9.tar.bz2 rockbox-067262dbf09d63fb645d1c2e67d225325b6854c9.tar.xz | |
Moved lcd default contrast knowledge from settings.c to lcd driver. Now lcd_init sets default contrast until settings are read.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3824 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/lcd-player.c | 7 | ||||
| -rw-r--r-- | firmware/drivers/lcd-recorder.c | 41 |
2 files changed, 31 insertions, 17 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index 6f58f8e..bbb157a 100644 --- a/firmware/drivers/lcd-player.c +++ b/firmware/drivers/lcd-player.c @@ -278,6 +278,11 @@ bool lcdx_putc(int x, int y, unsigned short ch) return false; } +int lcd_default_contrast(void) +{ + return 30; +} + void lcd_clear_display(void) { int i; @@ -497,6 +502,8 @@ void lcd_init (void) pattern_size=3; /* Last pattern, 3 for old LCD, 7 for new LCD */ } + lcd_set_contrast(lcd_default_contrast()); + create_thread(scroll_thread, scroll_stack, sizeof(scroll_stack), scroll_name); } diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 00b4ed7..597c7d2 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -29,6 +29,7 @@ #include "debug.h" #include "system.h" #include "font.h" +#include "hwcompat.h" /*** definitions ***/ @@ -113,6 +114,15 @@ static unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +int lcd_default_contrast(void) +{ +#ifdef SIMULATOR + return 30; +#else + return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; +#endif +} + #ifdef SIMULATOR void lcd_init(void) @@ -132,23 +142,20 @@ void lcd_init (void) PBCR2 &= 0xff00; /* MD = 00 */ PBIOR |= 0x000f; /* IOR = 1 */ - /* inits like the original firmware */ - lcd_write(true, LCD_SOFTWARE_RESET); - lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); - lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ - lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */ - lcd_write(true, LCD_SET_DISPLAY_ON); - lcd_write(true, LCD_SET_NORMAL_DISPLAY); - lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */ - lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */ - lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0); -#if 0 /* done later, depending on h/w mask bit and settings */ - lcd_write(true, LCD_SET_CONTRAST_CONTROL_REGISTER); - lcd_write(true, 0xF1); /* contrast set to 49/64 */ -#endif - lcd_write(true, LCD_SET_PAGE_ADDRESS); - lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0); - lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0); + /* inits like the original firmware */ + lcd_write(true, LCD_SOFTWARE_RESET); + lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); + lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ + lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */ + lcd_write(true, LCD_SET_DISPLAY_ON); + lcd_write(true, LCD_SET_NORMAL_DISPLAY); + lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */ + lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */ + lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0); + lcd_set_contrast(lcd_default_contrast()); + lcd_write(true, LCD_SET_PAGE_ADDRESS); + lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0); + lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0); lcd_clear_display(); lcd_update(); |