diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-10-12 17:09:33 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-10-12 17:09:33 +0000 |
commit | d160c10e37311e618b0f8b02a239da6abcbbac2c (patch) | |
tree | 28ad995ced27bc7fc6cd40fe49938aff233fe866 /firmware/target | |
parent | abd8c39a4d10283819a6f13ef13f77434966aa93 (diff) | |
download | rockbox-d160c10e37311e618b0f8b02a239da6abcbbac2c.tar.gz rockbox-d160c10e37311e618b0f8b02a239da6abcbbac2c.zip |
H10 LCD driver size reductions: Un-inline a function for H10 20GB, and introduce lcd_write_reg() for H10 5/6GB.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15090 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/iriver/h10/lcd-h10_20gb.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/iriver/h10/lcd-h10_5gb.c | 29 |
2 files changed, 16 insertions, 16 deletions
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c index a52e98f364..2c527fa4d9 100644 --- a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c +++ b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c | |||
@@ -101,9 +101,8 @@ static inline void lcd_send_data_swapped(unsigned v) | |||
101 | LCD2_PORT = LCD2_DATA_MASK | (v >> 8); | 101 | LCD2_PORT = LCD2_DATA_MASK | (v >> 8); |
102 | } | 102 | } |
103 | 103 | ||
104 | |||
105 | /* Write value to register */ | 104 | /* Write value to register */ |
106 | static inline void lcd_write_reg(int reg, int val) | 105 | static void lcd_write_reg(int reg, int val) |
107 | { | 106 | { |
108 | lcd_send_cmd(reg); | 107 | lcd_send_cmd(reg); |
109 | lcd_send_data(val); | 108 | lcd_send_data(val); |
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c index 7555c566f0..8972fd1e9c 100644 --- a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c +++ b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c | |||
@@ -74,6 +74,13 @@ static inline void lcd_send_data(unsigned v) | |||
74 | LCD2_PORT = LCD2_DATA_MASK | (v & 0xff); | 74 | LCD2_PORT = LCD2_DATA_MASK | (v & 0xff); |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Write value to register */ | ||
78 | static void lcd_write_reg(int reg, int val) | ||
79 | { | ||
80 | lcd_send_cmd(reg); | ||
81 | lcd_send_data(val); | ||
82 | } | ||
83 | |||
77 | 84 | ||
78 | /*** hardware configuration ***/ | 85 | /*** hardware configuration ***/ |
79 | 86 | ||
@@ -150,17 +157,14 @@ void lcd_yuv_blit(unsigned char * const src[3], | |||
150 | y1 = y + height - 1; | 157 | y1 = y + height - 1; |
151 | 158 | ||
152 | /* max horiz << 8 | start horiz */ | 159 | /* max horiz << 8 | start horiz */ |
153 | lcd_send_cmd(R_HORIZ_RAM_ADDR_POS); | 160 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0); |
154 | lcd_send_data((x1 << 8) | x0); | 161 | |
155 | |||
156 | /* max vert << 8 | start vert */ | 162 | /* max vert << 8 | start vert */ |
157 | lcd_send_cmd(R_VERT_RAM_ADDR_POS); | 163 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0); |
158 | lcd_send_data((y1 << 8) | y0); | ||
159 | 164 | ||
160 | /* start vert << 8 | start horiz */ | 165 | /* start vert << 8 | start horiz */ |
161 | lcd_send_cmd(R_RAM_ADDR_SET); | 166 | lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0); |
162 | lcd_send_data((y0 << 8) | x0); | 167 | |
163 | |||
164 | /* start drawing */ | 168 | /* start drawing */ |
165 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); | 169 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); |
166 | 170 | ||
@@ -320,16 +324,13 @@ void lcd_update_rect(int x0, int y0, int width, int height) | |||
320 | } | 324 | } |
321 | 325 | ||
322 | /* max horiz << 8 | start horiz */ | 326 | /* max horiz << 8 | start horiz */ |
323 | lcd_send_cmd(R_HORIZ_RAM_ADDR_POS); | 327 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0); |
324 | lcd_send_data((x1 << 8) | x0); | ||
325 | 328 | ||
326 | /* max vert << 8 | start vert */ | 329 | /* max vert << 8 | start vert */ |
327 | lcd_send_cmd(R_VERT_RAM_ADDR_POS); | 330 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0); |
328 | lcd_send_data((y1 << 8) | y0); | ||
329 | 331 | ||
330 | /* start vert << 8 | start horiz */ | 332 | /* start vert << 8 | start horiz */ |
331 | lcd_send_cmd(R_RAM_ADDR_SET); | 333 | lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0); |
332 | lcd_send_data((y0 << 8) | x0); | ||
333 | 334 | ||
334 | /* start drawing */ | 335 | /* start drawing */ |
335 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); | 336 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); |