created separate function for hex to char

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of SS_SensePOC2P0_11Dec2017_USERPID by rashmi v

Revision:
35:43133f017ed4
Parent:
31:0f67acfc6236
Child:
37:92fcbf22bf91
--- a/touch_modules.cpp	Sun Jul 23 16:50:59 2017 +0000
+++ b/touch_modules.cpp	Sat Jul 29 10:38:05 2017 +0000
@@ -6,8 +6,8 @@
 //InterruptIn Touch_D(PTD6);
 InterruptIn Touch_D(PTD2);
 int i;
-unsigned int xt;
-unsigned int yt;
+unsigned int xt=0;
+unsigned int yt=0;
 Serial kc(USBTX, USBRX);
 
 
@@ -49,15 +49,15 @@
 unsigned char touch_main()    //determining the touch for home screen
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
-                  if ( ((xt >=SYSCFG_MAIN_X_MIN) && (xt<=SYSCFG_MAIN_X_MAX)) && ( (yt>=SYSCFG_MAIN_Y_MIN) && (yt<= SYSCFG_MAIN_Y_MAX) ) ) // system configuration
+                  if ( ((xt >=SYSCFG_HOME_X_MIN) && (xt<=SYSCFG_HOME_X_MAX)) && ( (yt>=SYSCFG_HOME_Y_MIN) && (yt<= SYSCFG_HOME_Y_MAX) ) ) // system configuration
                        {
                           
                           state=2;
                         }
     
-                 else if ( ((xt >=TEST_MAIN_X_MIN) && (xt<=TEST_MAIN_X_MAX)) && ( (yt>=TEST_MAIN_Y_MIN) && (yt<=TEST_MAIN_Y_MAX) ) ) // test
+                 else if ( ((xt >=TEST_HOME_X_MIN) && (xt<=TEST_HOME_X_MAX)) && ( (yt>=TEST_HOME_Y_MIN) && (yt<=TEST_HOME_Y_MAX) ) ) // test
                       {
                            state=3;
                  }   
@@ -71,21 +71,21 @@
 unsigned char touch_main_1()    //determining the touch for System Configuration screen
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
-                  if ( ((xt >=BLE_MAIN_X_MIN) && (xt<=BLE_MAIN_X_MAX)) && ( (yt>= BLE_MAIN_Y_MIN) && (yt<=BLE_MAIN_Y_MAX) ) ) // ble
+                  if ( ((xt >=BT_MAIN_X_MIN) && (xt<=BT_MAIN_X_MAX)) && ( (yt>= BT_MAIN_Y_MIN) && (yt<=BT_MAIN_Y_MAX) ) ) // ble
                        {
                           
                           state=12;
                         }
     
-                 else if ( ((xt >=ERASE_MAIN_X_MIN) && (xt<=ERASE_MAIN_X_MAX)) && ( (yt>=ERASE_MAIN_Y_MIN) && (yt<=ERASE_MAIN_Y_MAX) ) ) // erase
+                 else if ( ((xt >=DELETE_MAIN_X_MIN) && (xt<=DELETE_MAIN_X_MAX)) && ( (yt>=DELETE_MAIN_Y_MIN) && (yt<=DELETE_MAIN_Y_MAX) ) ) // DELETE
                       {
                           // state=4;
                         
                           
                        }
-                 else if ( ((xt >=FILE_MAIN_X_MIN) && (xt<=FILE_MAIN_X_MAX)) && ( (yt>=FILE_MAIN_Y_MIN) && (yt<=FILE_MAIN_Y_MAX) ) ) // file
+                 else if ( ((xt >=PATIENT_INFO_MAIN_X_MIN) && (xt<=PATIENT_INFO_MAIN_X_MAX)) && ( (yt>=PATIENT_INFO_MAIN_Y_MIN) && (yt<=PATIENT_INFO_MAIN_Y_MAX) ) ) // file
                       {
                                 state=11;
                          
@@ -105,7 +105,7 @@
  unsigned char touch_main_2()    //determining the touch for TEST screen
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
                   if ( ((xt >=BG_MAIN_X_MIN) && (xt<=BG_MAIN_X_MAX)) && ( (yt>=BG_MAIN_Y_MIN) && (yt<=BG_MAIN_Y_MAX) ) ) // GLC
                        {
@@ -144,7 +144,7 @@
 unsigned char touch_ecg()     // determining the touch for ecg  main screen
 {
       
-      unsigned char state;
+      unsigned char state=0;
                  if ( ((xt >=START_MAIN_X_MIN) && (xt<=START_MAIN_X_MAX)) && ( (yt>=START_MAIN_Y_MIN) && (yt<=START_MAIN_Y_MAX) ) ) // START
                        {
                           
@@ -165,7 +165,7 @@
 unsigned char touch_ret()     // determining the touch for ecg screen after the test
 {
       
-      unsigned char state;
+      unsigned char state=0;
       int8_t type=0;
        type=eprom_read_8(30);
                  
@@ -174,7 +174,7 @@
                                 state=3;
                          
                        }
-                 else if ( ((xt >=RETEST_MAIN_X_MIN) && (xt<=RETEST_MAIN_X_MAX)) && ( (yt>=RETEST_MAIN_Y_MIN) && (yt<=RETEST_MAIN_Y_MAX) ) ) // RETEST
+                 else if ( ((xt >=RETEST_HOME_X_MIN) && (xt<=RETEST_HOME_X_MAX)) && ( (yt>=RETEST_HOME_Y_MIN) && (yt<=RETEST_HOME_Y_MAX) ) ) // RETEST
                        {
                                  if (type==0)
                                      state=7;
@@ -194,7 +194,7 @@
 unsigned char touch_bp()   // //determining the touch for bp main screen
 
 {
-        unsigned char state;
+        unsigned char state=0;
                 if ( ((xt >=START_MAIN_X_MIN) && (xt<=START_MAIN_X_MAX)) && ( (yt>=START_MAIN_Y_MIN) && (yt<=START_MAIN_Y_MAX) ) ) // START
                        {
                           
@@ -215,7 +215,7 @@
     
   unsigned char touch_glc()        //determining the touch for GLC screen
     {
-        unsigned char state;
+        unsigned char state=0;
 
                /* if ( ((xt >=70) && (xt<=170)) && ( (yt>= 140) && (yt<= 195) ) ) // START
                        {
@@ -248,7 +248,7 @@
                            eprom_write_16(20,2); 
                          
                        }
-                 else if ( ((xt >=HOME_MAIN_X_MIN) && (xt<=HOME_MAIN_X_MAX)) && ( (yt>=HOME_MAIN_Y_MIN) && (yt<=HOME_MAIN_Y_MAX) ) ) // return
+                 else if ( ((xt >=BG_RET_MAIN_X_MIN) && (xt<=BG_RET_MAIN_X_MAX)) && ( (yt>=BG_RET_MAIN_Y_MIN) && (yt<=BG_RET_MAIN_Y_MAX) ) ) // return
                        {
                            state=3;         //////////
                  
@@ -266,7 +266,7 @@
  unsigned char touch_again_ecg()    //determining the touch for Repeat test 
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
                     if ( ((xt >=YES_MAIN_X_MIN) && (xt<=YES_MAIN_X_MAX)) && ( (yt>=YES_MAIN_Y_MIN) && (yt<=YES_MAIN_Y_MAX) ) ) // YES
                       {
@@ -287,7 +287,7 @@
  unsigned char touch_again_glc()    //determining the touch for Repeat test 
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
                     if ( ((xt >=YES_MAIN_X_MIN) && (xt<=YES_MAIN_X_MAX)) && ( (yt>=YES_MAIN_Y_MIN) && (yt<=YES_MAIN_Y_MAX) ) ) // YES
                       {
@@ -307,7 +307,7 @@
    unsigned char touch_again_bp()    //determining the touch for Repeat test 
 {
     
-    unsigned char state;
+    unsigned char state=0;
         
                     if ( ((xt >=YES_MAIN_X_MIN) && (xt<=YES_MAIN_X_MAX)) && ( (yt>=YES_MAIN_Y_MIN) && (yt<=YES_MAIN_Y_MAX) ) ) // YES
                       {
@@ -327,7 +327,7 @@
  unsigned char BT_return()   // //determining the touch for bp main screen
 
 {
-        unsigned char state;
+        unsigned char state=0;
                
                      if ( ((xt >=MAIN_X_MIN) && (xt<=MAIN_X_MAX)) && ( (yt>=MAIN_Y_MIN) && (yt<=MAIN_Y_MAX) ) ) // RETURN
                       {
@@ -449,7 +449,4 @@
     DigitalOut XL(PTC13);
     DigitalOut YU(PTC0);
     DigitalOut XR(PTB0);
-    }   
-    
-   
- 
\ No newline at end of file
+    }
\ No newline at end of file