C++ file for display control

Dependencies:   4DGL mbed ConfigFile

Fork of 4DGLtest by Stephane ROCHON

Revision:
11:a5b0d98794c0
Parent:
10:5706b75d40fa
--- a/display.cpp	Wed Jul 16 08:05:54 2014 +0000
+++ b/display.cpp	Wed Jul 16 19:15:40 2014 +0000
@@ -103,8 +103,8 @@
 */
 
 
-DigitalOut VGA_SOURCE( p7 ); // control line for video switch between internal and external video
-DigitalOut VGA_SELECT( p8 ); // select or deselect video switch
+//DigitalOut VGA_SOURCE( p7 ); // control line for video switch between internal and external video
+//DigitalOut VGA_SELECT( p8 ); // select or deselect video switch
 
 //Control lines for VGA driver board
 TFT_4DGL display(p13,p14,p15); // serial tx, serial rx, reset pin
@@ -117,7 +117,7 @@
     std::string cInput( cString );
     char* cText = new char[nStrLen+1];
     strncpy(cText, cInput.c_str(), nStrLen);
-    cText[nStrLen+1] = '\0';
+    cText[nStrLen] = '\0';
     return cText;
     }
     
@@ -177,11 +177,11 @@
     return ( nFont );
 }    
 
-int cRGB( int cRED, int cGREEN, int cBLUE )
+unsigned int cRGB( char cRED, char cGREEN, char cBLUE )
 {
     //assemble separate colors into 1 integer value as 0xRRGGBB
     //Display driver requires this format
-    int RGB = cBLUE + 8*cGREEN + 64*cRED;
+    unsigned int RGB = cBLUE + 256*cGREEN + 65536*cRED;
     return ( RGB );
 }    
 
@@ -190,6 +190,14 @@
     //decide to print data left aligned or right aligned
     //00 - 49 is left  side of screen
     //50 - 99 is right side of screen
+    
+    //00 = LSK1         50 = RSK1
+    //01 = LSK2         51 = RSK2
+    //02 = LSK3         52 = RSK3
+    //03 = LSK4         53 = RSK4
+    //05 = LSK5         54 = RSK5
+    //06 = LSK6         56 = RSK6
+
     int nHorPos = 0; 
     // nChars is number of characters on this line (24 or 48)
     // nCharWidth is the character width in pixels