diff options
Diffstat (limited to 'firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c')
-rw-r--r-- | firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c index 988f710660..75911614ab 100644 --- a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c +++ b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c | |||
@@ -161,18 +161,19 @@ void lcd_display_init(void) | |||
161 | lcd_sleep(false); | 161 | lcd_sleep(false); |
162 | } | 162 | } |
163 | 163 | ||
164 | void lcd_set_gram_area(int x, int y, int width, int height) | 164 | void lcd_set_gram_area(int x_start, int y_start, |
165 | int x_end, int y_end) | ||
165 | { | 166 | { |
166 | lcdctrl_bypass(1); | 167 | lcdctrl_bypass(1); |
167 | LCDC_CTRL |= RGB24B; | 168 | LCDC_CTRL |= RGB24B; |
168 | 169 | ||
169 | /* addresses setup */ | 170 | /* addresses setup */ |
170 | lcd_write_reg(WINDOW_H_START, y); | 171 | lcd_write_reg(WINDOW_H_START, y_start); |
171 | lcd_write_reg(WINDOW_H_END, height-1); | 172 | lcd_write_reg(WINDOW_H_END, y_end); |
172 | lcd_write_reg(WINDOW_V_START, x); | 173 | lcd_write_reg(WINDOW_V_START, x_start); |
173 | lcd_write_reg(WINDOW_V_END, width-1); | 174 | lcd_write_reg(WINDOW_V_END, x_end); |
174 | lcd_write_reg(GRAM_H_ADDR, y); | 175 | lcd_write_reg(GRAM_H_ADDR, y_start); |
175 | lcd_write_reg(GRAM_V_ADDR, x); | 176 | lcd_write_reg(GRAM_V_ADDR, x_start); |
176 | 177 | ||
177 | lcd_cmd(GRAM_WRITE); | 178 | lcd_cmd(GRAM_WRITE); |
178 | LCDC_CTRL &= ~RGB24B; | 179 | LCDC_CTRL &= ~RGB24B; |
@@ -183,7 +184,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
183 | int px = x, py = y; | 184 | int px = x, py = y; |
184 | int pxmax = x + width, pymax = y + height; | 185 | int pxmax = x + width, pymax = y + height; |
185 | 186 | ||
186 | lcd_set_gram_area(x, y, pxmax, pymax); | 187 | lcd_set_gram_area(x, y, pxmax-1, pymax-1); |
187 | 188 | ||
188 | for (py=y; py<pymax; py++) | 189 | for (py=y; py<pymax; py++) |
189 | { | 190 | { |