stupid mistake fixed, display basically working now!
authorhackbard <hackbard@staubsauger.localdomain>
Thu, 13 Sep 2007 01:09:48 +0000 (03:09 +0200)
committerhackbard <hackbard@staubsauger.localdomain>
Thu, 13 Sep 2007 01:09:48 +0000 (03:09 +0200)
betty/betty.c
betty/display.c
betty/display.h

index e5923e9..163a8e2 100644 (file)
@@ -23,7 +23,6 @@ int main() {
        char announce[]="betty - live from flash at 0x80000000! ;)\r\n";
        t_button button;
        u8 contrast;
-       int cnt;
 
        /* system init */
        pll_init();
@@ -81,6 +80,9 @@ int main() {
                                                contrast+=1;
                                        DISPLAY_SET_CONTRAST(contrast);
                                        break;
+                               case BUTTON_TV:
+                                       display_fill_screen(button.key[0]);
+                                       break;
                                default:
                                        display_clear_screen();
                                        break;
index e102141..b3d3e9c 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;
index b129d88..bed4b70 100644 (file)
@@ -65,9 +65,9 @@
                                        DISPLAY_CMD=(((b)&0x0f)<<4|((a)&0x0f)); \
                                        DISPLAY_CMD=0x8d; \
                                        DISPLAY_CMD=(((d)&0x0f)<<4|((c)&0x0f))
-#define DISPLAY_SET_BLACK(a,b,c,d)     DISPLAY_CMD=0x88; \
+#define DISPLAY_SET_BLACK(a,b,c,d)     DISPLAY_CMD=0x8e; \
                                        DISPLAY_CMD=(((b)&0x0f)<<4|((a)&0x0f)); \
-                                       DISPLAY_CMD=0x89; \
+                                       DISPLAY_CMD=0x8f; \
                                        DISPLAY_CMD=(((d)&0x0f)<<4|((c)&0x0f))
 #define DISPLAY_SET_PWM_FRC(p,f)       DISPLAY_CMD=(0x90| \
                                                     (((f&0x01)<<2)|(p&0x03)))
@@ -95,6 +95,7 @@
 #define DISPLAY_EXTENDED_FEATURES      DISPLAY_CMD=0xf0
 
 /* function prototypes */
+void display_fill_screen(u8 fill);
 void display_clear_screen(void);
 void display_init(void);
 void display_load_logo(u8 *src);