optimized load logo function (thnx to andersro)
[my-code/arm.git] / betty / display.c
index e102141..4d4e1e1 100644 (file)
@@ -14,7 +14,7 @@
  * functions
  */
 
-void display_clear_screen(void) {
+void display_fill_screen(u8 fill) {
 
        u8 page,width;
 
@@ -22,12 +22,17 @@ void display_clear_screen(void) {
                DISPLAY_SET_C_ADDR(0);
                DISPLAY_SET_PAGE_ADDR(page);
                for(width=0;width<DISPLAY_DIMX;width++) {
-                       DISPLAY_DATA=0x00;
-                       DISPLAY_DATA=0x00;
+                       DISPLAY_DATA=fill;
+                       DISPLAY_DATA=fill;
                }
        }
 }
 
+void display_clear_screen(void) {
+
+       display_fill_screen(0x00);
+}
+
 void display_init(void) {
 
        DISPLAY_EXIT_POWER_SAVE;
@@ -68,20 +73,17 @@ void display_load_logo(u8 *src) {
 
        u8 *s;
        u8 page,width;
-       u32 cnt;
 
        s=src;
        if(s==0)
                s=default_logo;
 
-       cnt=0;
        for(page=0;page<DISPLAY_PAGE_MAX;page++) {
                DISPLAY_SET_C_ADDR(0);
                DISPLAY_SET_PAGE_ADDR(page);
                for(width=0;width<DISPLAY_DIMX;width++) {
-                       DISPLAY_DATA=s[cnt];
-                       DISPLAY_DATA=s[cnt+1];
-                       cnt+=2;
+                       DISPLAY_DATA=*s++;
+                       DISPLAY_DATA=*s++;
                }
        }
 }