diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-player.c | 7 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 41 | ||||
-rw-r--r-- | firmware/export/lcd.h | 1 |
3 files changed, 32 insertions, 17 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index 6f58f8ec1a..bbb157a94f 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) | |||
278 | return false; | 278 | return false; |
279 | } | 279 | } |
280 | 280 | ||
281 | int lcd_default_contrast(void) | ||
282 | { | ||
283 | return 30; | ||
284 | } | ||
285 | |||
281 | void lcd_clear_display(void) | 286 | void lcd_clear_display(void) |
282 | { | 287 | { |
283 | int i; | 288 | int i; |
@@ -497,6 +502,8 @@ void lcd_init (void) | |||
497 | pattern_size=3; /* Last pattern, 3 for old LCD, 7 for new LCD */ | 502 | pattern_size=3; /* Last pattern, 3 for old LCD, 7 for new LCD */ |
498 | } | 503 | } |
499 | 504 | ||
505 | lcd_set_contrast(lcd_default_contrast()); | ||
506 | |||
500 | create_thread(scroll_thread, scroll_stack, | 507 | create_thread(scroll_thread, scroll_stack, |
501 | sizeof(scroll_stack), scroll_name); | 508 | sizeof(scroll_stack), scroll_name); |
502 | } | 509 | } |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 00b4ed78b2..597c7d246a 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "debug.h" | 29 | #include "debug.h" |
30 | #include "system.h" | 30 | #include "system.h" |
31 | #include "font.h" | 31 | #include "font.h" |
32 | #include "hwcompat.h" | ||
32 | 33 | ||
33 | /*** definitions ***/ | 34 | /*** definitions ***/ |
34 | 35 | ||
@@ -113,6 +114,15 @@ static unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | |||
113 | static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, | 114 | static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, |
114 | 0xff, 0xff, 0xff, 0xff}; | 115 | 0xff, 0xff, 0xff, 0xff}; |
115 | 116 | ||
117 | int lcd_default_contrast(void) | ||
118 | { | ||
119 | #ifdef SIMULATOR | ||
120 | return 30; | ||
121 | #else | ||
122 | return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; | ||
123 | #endif | ||
124 | } | ||
125 | |||
116 | #ifdef SIMULATOR | 126 | #ifdef SIMULATOR |
117 | 127 | ||
118 | void lcd_init(void) | 128 | void lcd_init(void) |
@@ -132,23 +142,20 @@ void lcd_init (void) | |||
132 | PBCR2 &= 0xff00; /* MD = 00 */ | 142 | PBCR2 &= 0xff00; /* MD = 00 */ |
133 | PBIOR |= 0x000f; /* IOR = 1 */ | 143 | PBIOR |= 0x000f; /* IOR = 1 */ |
134 | 144 | ||
135 | /* inits like the original firmware */ | 145 | /* inits like the original firmware */ |
136 | lcd_write(true, LCD_SOFTWARE_RESET); | 146 | lcd_write(true, LCD_SOFTWARE_RESET); |
137 | lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); | 147 | lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); |
138 | lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ | 148 | lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ |
139 | lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */ | 149 | lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */ |
140 | lcd_write(true, LCD_SET_DISPLAY_ON); | 150 | lcd_write(true, LCD_SET_DISPLAY_ON); |
141 | lcd_write(true, LCD_SET_NORMAL_DISPLAY); | 151 | lcd_write(true, LCD_SET_NORMAL_DISPLAY); |
142 | lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */ | 152 | lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */ |
143 | lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */ | 153 | lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */ |
144 | lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0); | 154 | lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0); |
145 | #if 0 /* done later, depending on h/w mask bit and settings */ | 155 | lcd_set_contrast(lcd_default_contrast()); |
146 | lcd_write(true, LCD_SET_CONTRAST_CONTROL_REGISTER); | 156 | lcd_write(true, LCD_SET_PAGE_ADDRESS); |
147 | lcd_write(true, 0xF1); /* contrast set to 49/64 */ | 157 | lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0); |
148 | #endif | 158 | lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0); |
149 | lcd_write(true, LCD_SET_PAGE_ADDRESS); | ||
150 | lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0); | ||
151 | lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0); | ||
152 | 159 | ||
153 | lcd_clear_display(); | 160 | lcd_clear_display(); |
154 | lcd_update(); | 161 | lcd_update(); |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 0818f9d92e..3f3ea972c3 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -44,6 +44,7 @@ extern void lcd_scroll_speed( int speed ); | |||
44 | extern void lcd_scroll_delay( int ms ); | 44 | extern void lcd_scroll_delay( int ms ); |
45 | extern void lcd_set_contrast(int val); | 45 | extern void lcd_set_contrast(int val); |
46 | extern void lcd_write( bool command, int byte ); | 46 | extern void lcd_write( bool command, int byte ); |
47 | extern int lcd_default_contrast(void); | ||
47 | 48 | ||
48 | #if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) | 49 | #if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) |
49 | extern void lcd_update(void); | 50 | extern void lcd_update(void); |