Commit 404e4f4a298f0062dfa405aa1b8b05cfd5be1690
Committed by
Anatolij Gustschin
1 parent
f4469f50b0
Exists in
v2017.01-smarct4x
and in
37 other branches
lcd: rename console_(row|col)
Rename console_(row|col) to console_curr_(row|col) to better distinguish it from console_(rows|cols). This is a preparatory step for extracting lcd console code into its own file. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Simon Glass <sjg@chromium.org> Cc: Anatolij Gustschin <agust@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Showing 1 changed file with 27 additions and 27 deletions Side-by-side Diff
common/lcd.c
... | ... | @@ -122,8 +122,8 @@ |
122 | 122 | |
123 | 123 | char lcd_is_enabled = 0; |
124 | 124 | |
125 | -static short console_col; | |
126 | -static short console_row; | |
125 | +static short console_curr_col; | |
126 | +static short console_curr_row; | |
127 | 127 | |
128 | 128 | static void *lcd_console_address; |
129 | 129 | static void *lcd_base; /* Start of framebuffer memory */ |
130 | 130 | |
131 | 131 | |
132 | 132 | |
133 | 133 | |
... | ... | @@ -188,31 +188,31 @@ |
188 | 188 | } |
189 | 189 | #endif |
190 | 190 | lcd_sync(); |
191 | - console_row -= rows; | |
191 | + console_curr_row -= rows; | |
192 | 192 | } |
193 | 193 | |
194 | 194 | /*----------------------------------------------------------------------*/ |
195 | 195 | |
196 | 196 | static inline void console_back(void) |
197 | 197 | { |
198 | - if (--console_col < 0) { | |
199 | - console_col = CONSOLE_COLS-1 ; | |
200 | - if (--console_row < 0) | |
201 | - console_row = 0; | |
198 | + if (--console_curr_col < 0) { | |
199 | + console_curr_col = CONSOLE_COLS-1; | |
200 | + if (--console_curr_row < 0) | |
201 | + console_curr_row = 0; | |
202 | 202 | } |
203 | 203 | |
204 | - lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, | |
205 | - console_row * VIDEO_FONT_HEIGHT, ' '); | |
204 | + lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH, | |
205 | + console_curr_row * VIDEO_FONT_HEIGHT, ' '); | |
206 | 206 | } |
207 | 207 | |
208 | 208 | /*----------------------------------------------------------------------*/ |
209 | 209 | |
210 | 210 | static inline void console_newline(void) |
211 | 211 | { |
212 | - console_col = 0; | |
212 | + console_curr_col = 0; | |
213 | 213 | |
214 | 214 | /* Check if we need to scroll the terminal */ |
215 | - if (++console_row >= CONSOLE_ROWS) | |
215 | + if (++console_curr_row >= CONSOLE_ROWS) | |
216 | 216 | console_scrollup(); |
217 | 217 | else |
218 | 218 | lcd_sync(); |
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | |
236 | 236 | switch (c) { |
237 | 237 | case '\r': |
238 | - console_col = 0; | |
238 | + console_curr_col = 0; | |
239 | 239 | |
240 | 240 | return; |
241 | 241 | case '\n': |
242 | 242 | |
... | ... | @@ -243,10 +243,10 @@ |
243 | 243 | |
244 | 244 | return; |
245 | 245 | case '\t': /* Tab (8 chars alignment) */ |
246 | - console_col += 8; | |
247 | - console_col &= ~7; | |
246 | + console_curr_col += 8; | |
247 | + console_curr_col &= ~7; | |
248 | 248 | |
249 | - if (console_col >= CONSOLE_COLS) | |
249 | + if (console_curr_col >= CONSOLE_COLS) | |
250 | 250 | console_newline(); |
251 | 251 | |
252 | 252 | return; |
... | ... | @@ -255,9 +255,9 @@ |
255 | 255 | |
256 | 256 | return; |
257 | 257 | default: |
258 | - lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, | |
259 | - console_row * VIDEO_FONT_HEIGHT, c); | |
260 | - if (++console_col >= CONSOLE_COLS) | |
258 | + lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH, | |
259 | + console_curr_row * VIDEO_FONT_HEIGHT, c); | |
260 | + if (++console_curr_col >= CONSOLE_COLS) | |
261 | 261 | console_newline(); |
262 | 262 | } |
263 | 263 | } |
... | ... | @@ -464,8 +464,8 @@ |
464 | 464 | debug("[LCD] Drawing the logo...\n"); |
465 | 465 | lcd_console_address = lcd_logo(); |
466 | 466 | |
467 | - console_col = 0; | |
468 | - console_row = 0; | |
467 | + console_curr_col = 0; | |
468 | + console_curr_row = 0; | |
469 | 469 | lcd_sync(); |
470 | 470 | } |
471 | 471 | |
472 | 472 | |
473 | 473 | |
... | ... | @@ -508,11 +508,11 @@ |
508 | 508 | lcd_enable(); |
509 | 509 | |
510 | 510 | /* Initialize the console */ |
511 | - console_col = 0; | |
511 | + console_curr_col = 0; | |
512 | 512 | #ifdef CONFIG_LCD_INFO_BELOW_LOGO |
513 | - console_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT; | |
513 | + console_curr_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT; | |
514 | 514 | #else |
515 | - console_row = 1; /* leave 1 blank line below logo */ | |
515 | + console_curr_row = 1; /* leave 1 blank line below logo */ | |
516 | 516 | #endif |
517 | 517 | |
518 | 518 | return 0; |
... | ... | @@ -1062,8 +1062,8 @@ |
1062 | 1062 | bitmap_plot(0, 0); |
1063 | 1063 | |
1064 | 1064 | #ifdef CONFIG_LCD_INFO |
1065 | - console_col = LCD_INFO_X / VIDEO_FONT_WIDTH; | |
1066 | - console_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT; | |
1065 | + console_curr_col = LCD_INFO_X / VIDEO_FONT_WIDTH; | |
1066 | + console_curr_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT; | |
1067 | 1067 | lcd_show_board_info(); |
1068 | 1068 | #endif /* CONFIG_LCD_INFO */ |
1069 | 1069 | |
... | ... | @@ -1100,8 +1100,8 @@ |
1100 | 1100 | |
1101 | 1101 | void lcd_position_cursor(unsigned col, unsigned row) |
1102 | 1102 | { |
1103 | - console_col = min_t(short, col, CONSOLE_COLS - 1); | |
1104 | - console_row = min_t(short, row, CONSOLE_ROWS - 1); | |
1103 | + console_curr_col = min_t(short, col, CONSOLE_COLS - 1); | |
1104 | + console_curr_row = min_t(short, row, CONSOLE_ROWS - 1); | |
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | int lcd_get_pixel_width(void) |