diff --git a/lib/gfx/LCD/LCD_Driver.c b/lib/gfx/LCD/LCD_Driver.c index 51f48ec2bbe135596b8dea9f74649a610970c3f9..481d6929ffdca96dc4711788621200d9faecd9b9 100644 --- a/lib/gfx/LCD/LCD_Driver.c +++ b/lib/gfx/LCD/LCD_Driver.c @@ -314,7 +314,7 @@ void LCD_Set(uint8_t *data, int len) uint8_t *LCD_Framebuffer(void) { - return (uint8_t*)screen; + return (uint8_t *)screen; } void LCD_Update(void) @@ -322,8 +322,9 @@ void LCD_Update(void) LCD_Set((uint8_t *)screen, sizeof(screen)); } -static Color lcd_fb_encode_color_rgb(struct framebuffer *fb, uint8_t r, - uint8_t g, uint8_t b) { +static Color +lcd_fb_encode_color_rgb(struct framebuffer *fb, uint8_t r, uint8_t g, uint8_t b) +{ r >>= (8 - 5); g >>= (8 - 6); b >>= (8 - 5); @@ -336,21 +337,22 @@ static Color lcd_fb_encode_color_rgb(struct framebuffer *fb, uint8_t r, return o; } -static void lcd_fb_update(struct framebuffer *fb) { +static void lcd_fb_update(struct framebuffer *fb) +{ LCD_Update(); } -static struct framebuffer framebuffer = { - .data = screen, - .width = LCD_WIDTH, - .height = LCD_HEIGHT, - .stride = LCD_WIDTH * LCD_HEIGHT * 2, - .orientation = FB_O_180, +static struct framebuffer framebuffer = { .data = screen, + .width = LCD_WIDTH, + .height = LCD_HEIGHT, + .stride = LCD_WIDTH * LCD_HEIGHT * 2, + .orientation = FB_O_180, - .encode_color_rgb = lcd_fb_encode_color_rgb, - .update = lcd_fb_update -}; + .encode_color_rgb = + lcd_fb_encode_color_rgb, + .update = lcd_fb_update }; -struct framebuffer *LCD_framebuffer(void) { +struct framebuffer *LCD_framebuffer(void) +{ return &framebuffer; }