]> hackdaworld.org Git - my-code/arm.git/commitdiff
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 e5923e9855cb05193b28cc455f2669114b86c861..163a8e23281eb97d2a5c71e1be8bd8bc8c9830c7 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 e102141d2a562ce4d7a87cea7c902fac3dbf832d..b3d3e9c89ff27d6c7d87d28c1da176f76f06354d 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 b129d8815cd5f9cc79aecd1b99d99c237017f5c9..bed4b7012de8a4126ae05805738a269d082bbae1 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);