lcd: introduce lcd_set_cmap
Reduce the lcd_display_bitmap #ifdef complexity by extracting Atmel-specific code for setting cmap for bitmap images into a new function lcd_set_cmap(). A default version is implemented with the remainder of the code. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Bo Shen <voice.shen@atmel.com> Tested-by: Josh Wu <josh.wu@atmel.com> Cc: Bo Shen <voice.shen@atmel.com> Cc: Simon Glass <sjg@chromium.org> Cc: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
committed by
Anatolij Gustschin
parent
2306457c45
commit
0b29a8969e
@@ -11,6 +11,7 @@
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <lcd.h>
|
||||
#include <bmp_layout.h>
|
||||
#include <atmel_lcdc.h>
|
||||
|
||||
/* configurable parameters */
|
||||
@@ -80,6 +81,16 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < colors; ++i) {
|
||||
bmp_color_table_entry_t cte = bmp->color_table[i];
|
||||
lcd_setcolreg(i, cte.red, cte.green, cte.blue);
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_ctrl_init(void *lcdbase)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
Reference in New Issue
Block a user