]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/LcdDisplay.c
Add fixes for it to work properly on microcontroller
[oswald.git] / ui / LcdDisplay.c
index 87bae7fe197f6f0382bc87451fae880d9a42b4e7..dbf775fbf4b6da665017c0391f15d35a682568a3 100644 (file)
@@ -4,11 +4,6 @@
 
 #include "LcdDisplay.h"
 
-#define NUM_LCD_ROWS  96
-#define NUM_LCD_COL_BYTES  ( 12 )
-#define MAX_FONT_ROWS ( 19 )
-
-
 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;
@@ -51,6 +46,7 @@ void DrawLcdLineBresenham(u8t xstart, u8t ystart, u8t xend, u8t yend)
                }
                lcd_set_pixel(x, y, TRUE);
        }
+       // lcd_update_display();
 }
 
 void DrawLcdLineBresenhamWW(u8t xstart, u8t ystart, u8t xend, u8t yend, u8t thickness)
@@ -107,16 +103,17 @@ void DrawLcdLineBresenhamWW(u8t xstart, u8t ystart, u8t xend, u8t yend, u8t thic
                        lcd_set_pixel(x, y+i, TRUE);
                }
        }
+       // lcd_update_display();
 }
 
 u8t WriteLcdCharacter(u8t x, u8t y, u8t Character)
 {
        u8t CharacterHeight = GetCharacterHeight();
        u8t CharacterWidth = GetCharacterWidth(Character);
-       unsigned int bitmap[MAX_FONT_ROWS];
-       register lx, ly;
+       u16t bitmap[MAX_FONT_ROWS];
+       int lx, ly;
 
-       GetCharacterBitmap(Character,(unsigned int*)&bitmap);
+       GetCharacterBitmap(Character, bitmap);
 
        // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight);
        for (ly=0; ly<CharacterHeight; ly++) {
@@ -131,13 +128,13 @@ u8t WriteLcdCharacter(u8t x, u8t y, u8t Character)
                }
                // printf("\n");
        }
-
+       // lcd_update_display();
        return CharacterWidth + GetFontSpacing();
 }
 
-void WriteLcdString(u8t x, u8t y, u8t *str)
+void WriteLcdString(u8t x, u8t y, char *str)
 {
-       register lx, i, strl;
+       int lx, i, strl;
 
        strl = oswald_strlen(str);
        if (strl == 0)
@@ -152,8 +149,8 @@ void WriteLcdString(u8t x, u8t y, u8t *str)
 
 void WriteLcdNumber(u8t x, u8t y, s16t number)
 {
-       register lx, i, strl;
-       u8t str[8];
+       int lx, i, strl;
+       char str[8];
 
        itoa(number, str, 10);
        strl = oswald_strlen(str);