
Dear Jeroen,
In message 50E86DFC.20304@myspectrum.nl you wrote:
While looking at the common/lcd.c I fail to understand why it declares and uses global variables like lcd_color_fg, lcd_color_color_bg, lcd_base and relies on the drivers / boards to provide them, leading to code duplication. It also provides getters / setters for some of these variables.
To me it seems more logical to have these variables in lcd.c itself. This construction has been around since at least 2004 though, so I tend to think I am missing something.
Does someone know the reason why these variables are not part of lcd.c itself?
The code has gone through a number of more or heavy restructuring, so it's difficult to tell what was the original design, and which might just be incomplete cleanup or similar.
Fact is, that lcd_color_fg and lcd_color_color_bg are nowhere used outside common/lcd.c - with a single exception: drivers/video/tegra.c does a
color ^= lcd_color_fg;
once - but this should be trivial to fix by changing it into
color ^= lcd_getfgcolor();
Hm... guess I should submit a cleanup patch :-)
Best regards,
Wolfgang Denk