diff options
Diffstat (limited to 'firmware/drivers/lcd-player.c')
-rw-r--r-- | firmware/drivers/lcd-player.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index 90e1d48e00..d040342862 100644 --- a/firmware/drivers/lcd-player.c +++ b/firmware/drivers/lcd-player.c | |||
@@ -111,6 +111,8 @@ static char lcd_cram; | |||
111 | static char lcd_pram; | 111 | static char lcd_pram; |
112 | static char lcd_iram; | 112 | static char lcd_iram; |
113 | 113 | ||
114 | static unsigned char lcd_data_byte; /* global write buffer */ | ||
115 | |||
114 | unsigned short buffer_xlcd[11][2]; | 116 | unsigned short buffer_xlcd[11][2]; |
115 | unsigned short buffer_lcd_mirror[11][2]; | 117 | unsigned short buffer_lcd_mirror[11][2]; |
116 | 118 | ||
@@ -122,7 +124,7 @@ unsigned char hardware_buffer_lcd[11][2]; | |||
122 | static void lcd_free_pat(int map_ch) | 124 | static void lcd_free_pat(int map_ch) |
123 | { | 125 | { |
124 | int x, y; | 126 | int x, y; |
125 | unsigned short substitute_char; | 127 | unsigned char substitute_char; |
126 | 128 | ||
127 | int pat; | 129 | int pat; |
128 | pat=extended_chars_mapped[map_ch]; | 130 | pat=extended_chars_mapped[map_ch]; |
@@ -140,8 +142,8 @@ static void lcd_free_pat(int map_ch) | |||
140 | #ifdef SIMULATOR | 142 | #ifdef SIMULATOR |
141 | hardware_buffer_lcd[x][y]=substitute_char; | 143 | hardware_buffer_lcd[x][y]=substitute_char; |
142 | #else | 144 | #else |
143 | lcd_write(true, LCD_CURSOR(x, y)); | 145 | lcd_write_command(LCD_CURSOR(x, y)); |
144 | lcd_write(false, substitute_char); | 146 | lcd_write_data(&substitute_char, 1); |
145 | #endif | 147 | #endif |
146 | } | 148 | } |
147 | } | 149 | } |
@@ -240,8 +242,8 @@ void xlcd_update(void) | |||
240 | #ifdef SIMULATOR | 242 | #ifdef SIMULATOR |
241 | hardware_buffer_lcd[x][y]=hw_ch; | 243 | hardware_buffer_lcd[x][y]=hw_ch; |
242 | #else | 244 | #else |
243 | lcd_write(true,LCD_CURSOR(x,y)); | 245 | lcd_write_command(LCD_CURSOR(x,y)); |
244 | lcd_write(false, hw_ch); | 246 | lcd_write_data(&hw_ch, 1); |
245 | #endif | 247 | #endif |
246 | } | 248 | } |
247 | } | 249 | } |
@@ -274,8 +276,9 @@ bool lcdx_putc(int x, int y, unsigned short ch) | |||
274 | #ifdef SIMULATOR | 276 | #ifdef SIMULATOR |
275 | hardware_buffer_lcd[x][y]=lcd_char; | 277 | hardware_buffer_lcd[x][y]=lcd_char; |
276 | #else | 278 | #else |
277 | lcd_write(true, LCD_CURSOR(x, y)); | 279 | lcd_data_byte = (unsigned char) lcd_char; |
278 | lcd_write(false, lcd_char); | 280 | lcd_write_command(LCD_CURSOR(x, y)); |
281 | lcd_write_data(&lcd_data_byte, 1); | ||
279 | #endif | 282 | #endif |
280 | return false; | 283 | return false; |
281 | } | 284 | } |
@@ -405,16 +408,14 @@ void lcd_define_pattern(int pat, char *pattern) | |||
405 | #ifndef SIMULATOR | 408 | #ifndef SIMULATOR |
406 | void lcd_define_hw_pattern (int which,char *pattern,int length) | 409 | void lcd_define_hw_pattern (int which,char *pattern,int length) |
407 | { | 410 | { |
408 | int i; | 411 | lcd_write_command(lcd_pram | which); |
409 | lcd_write(true,lcd_pram | which); | 412 | lcd_write_data(pattern, length); |
410 | for (i=0;i<length;i++) | ||
411 | lcd_write(false,pattern[i]); | ||
412 | } | 413 | } |
413 | 414 | ||
414 | void lcd_double_height(bool on) | 415 | void lcd_double_height(bool on) |
415 | { | 416 | { |
416 | if(new_lcd) | 417 | if(new_lcd) |
417 | lcd_write(true,on?9:8); | 418 | lcd_write_command(on?9:8); |
418 | } | 419 | } |
419 | 420 | ||
420 | static char icon_pos[] = | 421 | static char icon_pos[] = |
@@ -463,20 +464,21 @@ void lcd_icon(int icon, bool enable) | |||
463 | pos = icon_pos[icon]; | 464 | pos = icon_pos[icon]; |
464 | mask = icon_mask[icon]; | 465 | mask = icon_mask[icon]; |
465 | 466 | ||
466 | lcd_write(true, LCD_ICON(pos)); | 467 | lcd_write_command(LCD_ICON(pos)); |
467 | 468 | ||
468 | if(enable) | 469 | if(enable) |
469 | icon_mirror[pos] |= mask; | 470 | icon_mirror[pos] |= mask; |
470 | else | 471 | else |
471 | icon_mirror[pos] &= ~mask; | 472 | icon_mirror[pos] &= ~mask; |
472 | 473 | ||
473 | lcd_write(false, icon_mirror[pos]); | 474 | lcd_write_data(&icon_mirror[pos], 1); |
474 | } | 475 | } |
475 | 476 | ||
476 | void lcd_set_contrast(int val) | 477 | void lcd_set_contrast(int val) |
477 | { | 478 | { |
478 | lcd_write(true, lcd_contrast_set); | 479 | lcd_data_byte = (unsigned char) (31 - val); |
479 | lcd_write(false, 31-val); | 480 | lcd_write_command(lcd_contrast_set); |
481 | lcd_write_data(&lcd_data_byte, 1); | ||
480 | } | 482 | } |
481 | #endif /* SIMULATOR */ | 483 | #endif /* SIMULATOR */ |
482 | 484 | ||
@@ -763,7 +765,7 @@ void lcd_cursor(int x, int y) | |||
763 | value=0x80|(x+0x54); | 765 | value=0x80|(x+0x54); |
764 | break; | 766 | break; |
765 | } | 767 | } |
766 | lcd_write(true,value); | 768 | lcd_write_command(value); |
767 | } | 769 | } |
768 | #endif | 770 | #endif |
769 | 771 | ||