Check this one ! mbos setup changed, WTX hor pos changed, no font style check, no checksum check

Dependencies:   4DGL MODSERIAL mbed mbos

Fork of CDU_Mbed_21 by Engravity-CDU

Revision:
11:d60c746c097c
Parent:
9:9a5f1b389973
--- a/screen_handler.cpp	Sun Jul 20 20:11:24 2014 +0000
+++ b/screen_handler.cpp	Mon Jul 21 14:24:15 2014 +0000
@@ -17,12 +17,18 @@
 extern DigitalOut DSPY;
 extern DigitalOut  MSG;
 extern DigitalOut OFST;
+
+//VGA control lines
+extern DigitalOut VGA_SOURCE;
+extern DigitalOut VGA_SELECT;
+
 extern void CDU_SET_BGL_INTENSITY( int nVal );      //Prototype of function controlling CDU backlight (declared in keyboard.cpp)
 extern int nFontSize( int nfont_number );           //Prototype of function for fontselection (declared in display.cpp)
 extern int nFontWidth (int nfont_number );          //Prototype of function to retrieve font width (declared in display.cpp)
 extern int nLine2Pixel( int nLine );                //Prototype of function to calculate vertical pixelposition from line number (declared in display.cpp)
 extern int LeftOrRight( int nTextLine, string cString, int nChars, int nCharWidth ); //declared in display.cpp
 extern int cRGB( char cRED, char cGREEN, char cBLUE ); //Prototype of function for assembly color word (declared in display.cpp)
+
 // FS_data_update_ID:
 // These global flags indicate what data has been updated.
 // Should be tested when FS_DATA_EVENT occurs.
@@ -32,6 +38,7 @@
 extern int Text_Line_Update     ;    // equal to line number whose text was updated, must be reset to 0 when text has been read
 extern int Key_Maintext_Update  ;    // equal to keynumber whose main text line was updated, must be reset to -1 (!)when text has been read
 extern int Key_Subtext_Update   ;    // equal to keynumber whose sub text line was updated, must be reset to -1 (!) when text has been read
+extern int S_Exec               ;    // setup flag
                                   
 // --------------------------------------------------------------------------------------------------
 void CDU_DSP_CSS()
@@ -42,9 +49,12 @@
 Text_Line_Update     ;    // : equal to line number whose text was updated, must be reset to 0 when text has been read
 Key_Maintext_Update  ;    // : equal to keynumber whose main text line was updated, must be reset to -1 (!)when text has been read
 Key_Subtext_Update   ;    // : equal to keynumber whose sub text line was updated, must be reset to -1 (!) when text has been read
+S_Exec               ;    // : when set do not update screen
 */
   
 {
+if (!S_Exec )
+{
     int nLine = 1;          //default line number
     int nCharsLine = 24;    //characters per line
     //check common flag
@@ -101,15 +111,7 @@
                                     cRGB( SELKEY_MAINTEXT[Key_Maintext_Update].text_RED ,SELKEY_MAINTEXT[Key_Maintext_Update].text_GREEN ,SELKEY_MAINTEXT[Key_Maintext_Update].text_BLUE ),
                                     1, 1 );
           
-            /*
-            display.graphic_string( SELKEY_MAINTEXT[Key_Maintext_Update].text ,                         //Text to display
-                                    12*24 ,    //Horizontal position
-                                    nLine2Pixel( nLine ),                                 //Vertical position
-                                    SELKEY_MAINTEXT[Key_Maintext_Update].font_size,        //Font
-                                    cRGB( SELKEY_MAINTEXT[Key_Maintext_Update].text_RED ,SELKEY_MAINTEXT[Key_Maintext_Update].text_GREEN ,SELKEY_MAINTEXT[Key_Maintext_Update].text_BLUE ),
-                                    1, 1 );
-            */
-           
+ 
             Key_Maintext_Update = -1;
         }
       
@@ -170,11 +172,31 @@
       
         if ( CDU_Status_Update == 1 )
         {
-/*                          
-                CDU_STATUS.stby_mode;           //  : 0 = operational mode, 1 = standby mode
-*/      
+             
+            if ( CDU_STATUS.stby_mode == 1 )       //  : 0 = operational mode, 1 = standby mode
+            {
+                    VGA_SELECT = 1;                //  : switch VGA off
+                    CDU_SET_BGL_INTENSITY( 0 );    //  : backlighting off
+                    MSG  = 0;                      //  : indicators off
+                    EXEC = 0;
+                    FAIL = 0;
+                    DSPY = 0;
+                    OFST = 0;
+                                
+            }
+            else
+            {
+                VGA_SELECT = 0;                    //  : switch VGA on
+                CDU_SET_BGL_INTENSITY( 100 );      //  : backlighting on  
+                MSG  = CDU_STATUS.msg_indicator;   //  : restore indicators
+                EXEC = CDU_STATUS.exec_indicator;
+                FAIL = CDU_STATUS.fail_indicator;
+                DSPY = CDU_STATUS.dspy_indicator;
+                OFST = CDU_STATUS.ofst_indicator;                                  
+            }
     
-        if ( CDU_STATUS.backlight )         // Backlight control
+    
+            if ( (CDU_STATUS.backlight) && (!CDU_STATUS.stby_mode) )         // Backlight control
             {
                 CDU_SET_BGL_INTENSITY( 100 );
             }
@@ -182,12 +204,13 @@
             {
                 CDU_SET_BGL_INTENSITY( 0 );
             }
+            
             // Set CDU indicators
-            MSG  = CDU_STATUS.msg_indicator;
-            EXEC = CDU_STATUS.exec_indicator;
-            FAIL = CDU_STATUS.fail_indicator;
-            DSPY = CDU_STATUS.dspy_indicator;
-            OFST = CDU_STATUS.ofst_indicator;
+            //MSG  = CDU_STATUS.msg_indicator;
+            //EXEC = CDU_STATUS.exec_indicator;
+            //FAIL = CDU_STATUS.fail_indicator;
+            //DSPY = CDU_STATUS.dspy_indicator;
+            //OFST = CDU_STATUS.ofst_indicator;
             CDU_Status_Update =0;
         }
         
@@ -198,5 +221,5 @@
         }
         
         FSdata_received_flag = false; // : reset commomn FS data update flag = all updates ready <-------- !!!!
-        
+}        
 }    
\ No newline at end of file