Commit a202c5bd24d68d640fcb0d6f43ff7f30ccc5780d

Authored by Hannes Petermaier
Committed by Anatolij Gustschin
1 parent 97562c12f1

common/lcd_console: ask only one-time for bg/fg-color per call

Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.

Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com>
Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Acked-by: Nikita Kiryanov <nikita@compulab.co.il>

Showing 1 changed file with 2 additions and 5 deletions Side-by-side Diff

common/lcd_console.c
... ... @@ -59,7 +59,8 @@
59 59 {
60 60 uchar *dest;
61 61 ushort row;
62   - int fg_color, bg_color;
  62 + int fg_color = lcd_getfgcolor();
  63 + int bg_color = lcd_getbgcolor();
63 64 int i;
64 65  
65 66 dest = (uchar *)(lcd_console_address +
... ... @@ -73,10 +74,6 @@
73 74 #else
74 75 uchar *d = dest;
75 76 #endif
76   -
77   - fg_color = lcd_getfgcolor();
78   - bg_color = lcd_getbgcolor();
79   -
80 77 uchar bits;
81 78 bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
82 79