]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/LcdDisplay.c
Bluetooth handling, screen reworks for icons
[oswald.git] / ui / LcdDisplay.c
index f889bbc4ba7b7b118f95ff2212fd5379a090831d..725908a4ab999860fbe6cb865b69ad6bfab5baa1 100644 (file)
@@ -5,6 +5,21 @@
 
 #include "LcdDisplay.h"
 
 
 #include "LcdDisplay.h"
 
+void oswald_draw_bitmap(const uint8_t xstart, const uint8_t ystart, const uint8_t width, const uint8_t height, const void *bmp)
+{
+       uint8_t x, y;
+       uint8_t *cb;
+
+       // we only draw set pixel, unset pixel remain as they are
+       for (y=0; y<height; y++) {
+               for (x=0; x<width; x++) {
+                       cb = (uint8_t *)(bmp + (y * ((width / 8)+((width % 8) ? 1:0))) + (x / 8));
+                       if (*cb & (1 << (x % 8)))
+                               hal_lcd_set_pixel(xstart + x, ystart + y, TRUE);
+               }
+       }
+}
+
 void DrawLcdLineBresenham(u8t xstart, u8t ystart, u8t xend, u8t yend)
 {
        int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
 void DrawLcdLineBresenham(u8t xstart, u8t ystart, u8t xend, u8t yend)
 {
        int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;