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:
8:422544d24df3
Parent:
7:6576a287e563
--- a/show_data.cpp	Thu Jul 17 10:09:14 2014 +0000
+++ b/show_data.cpp	Sun Jul 20 16:33:53 2014 +0000
@@ -1,23 +1,25 @@
 // L. van der Kolk, ELVEDEKA, Holland //
 // File:  show_data.cpp 
 
-// -----  Testing only --------------------------------------------
+// -----  FOR DEBUG ONLY ----------------------------
 // - Functions to test received and updated CDU data
-
+// --------------------------------------------------
 
 #include "mbed.h"
 #include "MODSERIAL.h"
 #include "mbos.h"
-#include "mbos_def.h"
+#include "mbos_def2.h"
 #include "FS_datastructures.h"
 
 extern mbos CDU_OS; 
 extern MODSERIAL SERIAL_DEBUG;
-static int command_cntr = 0;
+extern int FSdata_received_flag;
+
+int step_counter = 0;
 
 void test_update_flags()
 {
-    // Tset if DCU data was updated:
+// Test if DCU data was updated:
     
 // Background_Col_Update  : 1 when color was updated, must be reset to 0 when data has been read
 // CDU_Status_Update      : 1 when status was updated, must be reset to 0 when data has been read
@@ -28,7 +30,7 @@
   
   if ( Text_Line_Update != 0 ) {  //: textline was updated !
           // read textline data and print:
-          SERIAL_DEBUG.printf("\rTextline updated:\r\n");          
+          SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n");          
           SERIAL_DEBUG.printf("line        : %d\r\n",Text_Line_Update );                         // show line nr 
           //SERIAL_DEBUG.printf("WTX begin pos   : %d\r\n",pos );                          // show begin position   
           SERIAL_DEBUG.printf("fontsize is : %d\r\n",TEXTLINE[Text_Line_Update].font_size );     // show fontsize 
@@ -38,59 +40,63 @@
           SERIAL_DEBUG.printf("B_colour is : %d\r\n",TEXTLINE[Text_Line_Update].text_BLUE );     // show textcolour 
           SERIAL_DEBUG.printf("line text is: \r\n" );           
           SERIAL_DEBUG.printf("%s\r\n",TEXTLINE[Text_Line_Update].text );    // show line text
-          command_cntr++;
-          SERIAL_DEBUG.printf("command count : %d\r\n",command_cntr );    // : show counter for debugging
-       
-    }
+          
+          Text_Line_Update = 0;  // : reset FS data update ID flag
+     }
         
     if ( Background_Col_Update != 0 ) {  // : background colour was updated
           // read new colour data and print: 
-          SERIAL_DEBUG.printf("\rSBC command received:\r\n");
+          SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n");
           SERIAL_DEBUG.printf("background R_colour : %d\r\n",BACKGROUND_COL.BG_RED);
           SERIAL_DEBUG.printf("background G_colour : %d\r\n",BACKGROUND_COL.BG_GREEN);
           SERIAL_DEBUG.printf("background B_colour : %d\r\n",BACKGROUND_COL.BG_BLUE);
-          command_cntr++;
-          SERIAL_DEBUG.printf("command count : %d\r\n",command_cntr );    // : show counter for debugging
-        
+          
+          Background_Col_Update = 0;  // : reset FS data update ID flag       
     }            
 
     if ( CDU_Status_Update != 0 ) { // : CDU status was updated
          // read new status data and print: 
-          SERIAL_DEBUG.printf("\r\r Setting command received :\r\n" );
+          SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n" );
           SERIAL_DEBUG.printf("Message indicator is : %d \r\n", CDU_STATUS.msg_indicator);
           SERIAL_DEBUG.printf("EXEC indicator is : %d \r\n", CDU_STATUS.exec_indicator);
           SERIAL_DEBUG.printf("Backlight is : %d \r\n", CDU_STATUS.backlight); 
           SERIAL_DEBUG.printf("Standby mode is : %d \r\n", CDU_STATUS.stby_mode);
-          command_cntr++;
-          SERIAL_DEBUG.printf("command count : %d\r\n",command_cntr );    // : show counter for debugging          
-        
+          
+          CDU_Status_Update = 0;   // : reset FS data update ID flag
      }
         
      if ( DO_CLR_SCREEN != 0 ) {   // : clr screen request received
-          SERIAL_DEBUG.printf("\r\r CLR screen request received :\r\n" );
+          SERIAL_DEBUG.printf("\r\r CLR screen request read:\r\n" );
           SERIAL_DEBUG.printf("DO_CLR_CSCREEN : %d \r\n", DO_CLR_SCREEN );
-          command_cntr++;
-          SERIAL_DEBUG.printf("command count : %d\r\n",command_cntr );    // : show counter for debugging
-       
+          
+           DO_CLR_SCREEN = 0;
      }
      
-     if (Key_Maintext_Update >= 0) {  // : key maintext was updated
+     if (Key_Maintext_Update > -1) {  // : key maintext was updated
                              
-          SERIAL_DEBUG.printf("\rKey command received:\r\n"); 
-          SERIAL_DEBUG.printf("Key number is : %d\r\n",Key_Maintext_Update);                            
-          SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text );       // show text  
-          SERIAL_DEBUG.printf("Keyfontsize is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_size );  // show fontsize 
-          SERIAL_DEBUG.printf("Key fontstyle is: %c\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_style);  // show fontstyle 
-          SERIAL_DEBUG.printf("Key R_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_RED );   // show textcolour 
-          SERIAL_DEBUG.printf("Key G_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_GREEN ); // show textcolour 
-          SERIAL_DEBUG.printf("Key B_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_BLUE );  // show textcolour 
-           
+          SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); 
+          //SERIAL_DEBUG.printf("Key number is : %d\r\n",Key_Maintext_Update);
+                      
+         SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[50].text );      // show text
+         SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[51].text );       // show text
+         SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[52].text );       // show text 
+         
+          //SERIAL_DEBUG.printf("Keyfontsize is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_size );  // show fontsize 
+          //SERIAL_DEBUG.printf("Key fontstyle is: %c\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_style);  // show fontstyle 
+          //SERIAL_DEBUG.printf("Key R_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_RED );   // show textcolour 
+          //SERIAL_DEBUG.printf("Key G_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_GREEN ); // show textcolour 
+          //SERIAL_DEBUG.printf("Key B_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_BLUE );  // show textcolour 
+          
+          Key_Maintext_Update = -1; 
+          
+          step_counter=5;
+          SERIAL_DEBUG.printf("step_counter: %d\r\n", step_counter );  //  debug 
          
      }
      
-     if (Key_Subtext_Update >= 0) {  // : key subtext was updated
+     if (Key_Subtext_Update > -1) {  // : key subtext was updated
      
-          SERIAL_DEBUG.printf("\rKey command received:\r\n"); 
+          SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); 
           SERIAL_DEBUG.printf("Key number is : %d\r\n",Key_Subtext_Update);                            
           SERIAL_DEBUG.printf("Key SUBTEXT is  : %s\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text );       // show text  
           SERIAL_DEBUG.printf("Key fontsize is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].font_size );  // show fontsize 
@@ -99,16 +105,12 @@
           SERIAL_DEBUG.printf("Key G_colour is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text_GREEN ); // show textcolour 
           SERIAL_DEBUG.printf("Key B_colour is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text_BLUE );  // show textcolour     
           
+          Key_Subtext_Update = -1;
          
      }
+          
+     FSdata_received_flag = false; // : reset commomn FS data update flag
+     step_counter = 10;
+     SERIAL_DEBUG.printf("step_counter: %d\r\n", step_counter );  //  debug 
      
- /*   Text_Line_Update = 0;  // : reset FS data update ID flag
-     Background_Col_Update = 0;  // : reset FS data update ID flag
-     CDU_Status_Update = 0;   // : reset FS data update ID flag
-     CDU_Status_Update = 0;   // : reset FS data update ID flag  
-     DO_CLR_SCREEN = 0;
-     Key_Maintext_Update = -1;
-     Key_Subtext_Update = -1;
-*/
-       
 }
\ No newline at end of file