diff options
-rw-r--r-- | firmware/target/arm/lcd-c200_c200v2.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c index b3e8f0eb4f..619a03b61e 100644 --- a/firmware/target/arm/lcd-c200_c200v2.c +++ b/firmware/target/arm/lcd-c200_c200v2.c | |||
@@ -78,15 +78,19 @@ static inline void lcd_wait_write(void) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | /* send LCD data */ | 80 | /* send LCD data */ |
81 | static void lcd_send_data(const fb_data *data, int width) | 81 | static void lcd_send_pixel(const fb_data data) |
82 | { | 82 | { |
83 | while(width--) | 83 | lcd_wait_write(); |
84 | { | 84 | LCD1_DATA = data >> 8; |
85 | lcd_wait_write(); | 85 | lcd_wait_write(); |
86 | LCD1_DATA = *data >> 8; | 86 | LCD1_DATA = data & 0xff; |
87 | lcd_wait_write(); | 87 | } |
88 | LCD1_DATA = *data++ & 0xff; | 88 | |
89 | } | 89 | inline void lcd_write_data(const fb_data *data, int width) |
90 | { | ||
91 | do { | ||
92 | lcd_send_pixel(*data++); | ||
93 | } while(--width); | ||
90 | } | 94 | } |
91 | 95 | ||
92 | /* send LCD command */ | 96 | /* send LCD command */ |
@@ -129,14 +133,18 @@ static inline void lcd_delay(int delay) | |||
129 | } | 133 | } |
130 | 134 | ||
131 | /* send LCD data */ | 135 | /* send LCD data */ |
132 | static void lcd_send_data(const fb_data *data, int width) | 136 | void lcd_write_data(const fb_data *data, int width) |
133 | { | 137 | { |
134 | while(width--) | 138 | do { |
135 | { | ||
136 | DBOP_DOUT = *data << 8 | *data >> 8; | 139 | DBOP_DOUT = *data << 8 | *data >> 8; |
137 | data++; | 140 | data++; |
138 | while ((DBOP_STAT & (1<<10)) == 0); | 141 | |
139 | } | 142 | /* Wait if push fifo is full */ |
143 | while ((DBOP_STAT & (1<<6)) != 0); | ||
144 | } while(--width); | ||
145 | |||
146 | /* While push fifo is not empty */ | ||
147 | while ((DBOP_STAT & (1<<10)) == 0); | ||
140 | } | 148 | } |
141 | 149 | ||
142 | /* send LCD command */ | 150 | /* send LCD command */ |
@@ -184,7 +192,7 @@ bool lcd_button_support(void) | |||
184 | lcd_send_command(R_Y_ADDR_AREA, 0); | 192 | lcd_send_command(R_Y_ADDR_AREA, 0); |
185 | lcd_send_command(1, 0); | 193 | lcd_send_command(1, 0); |
186 | 194 | ||
187 | lcd_send_data(&data, 1); | 195 | lcd_write_data(&data, 1); |
188 | 196 | ||
189 | return true; | 197 | return true; |
190 | } | 198 | } |
@@ -445,7 +453,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
445 | lcd_send_command(y + height - 1 + 0x1a, 0); | 453 | lcd_send_command(y + height - 1 + 0x1a, 0); |
446 | 454 | ||
447 | do { | 455 | do { |
448 | lcd_send_data(addr, width); | 456 | lcd_write_data(addr, width); |
449 | addr += LCD_WIDTH; | 457 | addr += LCD_WIDTH; |
450 | } while (--height > 0); | 458 | } while (--height > 0); |
451 | 459 | ||