Added Patches for Display Quality

Dependents:   GPS_System_with_Google_Maps

Fork of NokiaLCD by Don DeGregori

Files at this revision

API Documentation at this revision

Comitter:
Ifrah
Date:
Thu Dec 13 23:58:05 2012 +0000
Parent:
5:18ae1fbb4c63
Commit message:
Added patches

Changed in this revision

NokiaLCD.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 18ae1fbb4c63 -r d829f93abd27 NokiaLCD.cpp
--- a/NokiaLCD.cpp	Fri May 25 01:48:37 2012 +0000
+++ b/NokiaLCD.cpp	Thu Dec 13 23:58:05 2012 +0000
@@ -67,7 +67,7 @@
         case LCD6610:
             command(0xCA);    // display control
             data(0);
-            data(31);
+            data(32);
             data(0);
             command(0xBB);
             data(1);
@@ -323,7 +323,27 @@
 void NokiaLCD::pixel(int x, int y, int colour) {
     _cs = 0;
     _window(x, y, 1, 1);
-    _putp(colour);
+     switch (_type) {
+        case LCD6100:
+        case PCF8833:
+           
+                _putp(colour);
+            
+            break;
+        case LCD6610:
+           
+                int r4 = (colour >> (16 + 4)) & 0xF;
+                int g4 = (colour >> (8 + 4)) & 0xF;
+                int b4 = (colour >> (0 + 4)) & 0xF;
+                int d1 = (r4 << 4) | g4;
+                int d2 = (b4 << 4) | r4;
+                int d3 = (g4 << 4) | b4;
+                data(d1); 
+                data(d2);   
+                data(d3);
+            
+            break;
+            }
     _cs = 1;
 }