diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2013-05-11 12:30:04 +0200 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2013-05-11 12:30:38 +0200 |
commit | ca8154741fd01e4b11461ce522da7d5e30a12d6e (patch) | |
tree | c60f09d1f91b2c7c3e520b220a60b90545ddf86d /firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c | |
parent | 3f4824b94fdfcb99cd8bfe8d7b60ba6106f3accd (diff) | |
download | rockbox-ca8154741fd01e4b11461ce522da7d5e30a12d6e.tar.gz rockbox-ca8154741fd01e4b11461ce522da7d5e30a12d6e.zip |
rk27xx: Slightly refactor lcd_set_gram_area()
Change-Id: I1040164220dd87b19b58be560eb5b628857bc284
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 | { |