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:
37:92fcbf22bf91
Parent:
35:43133f017ed4
Child:
39:69b09bd87502
--- a/main.cpp	Sat Jul 29 11:23:19 2017 +0000
+++ b/main.cpp	Sat Jul 29 12:12:28 2017 +0000
@@ -34,41 +34,35 @@
 
 
 int main(){
-
-
-
-  
-   DisableTouch();
-   gc.baud(115200);
-  
-   init_screen();    //initialize lcd
-   screen_main(); // display of main screen 
-   //state=10;
-   flag=0;
-   //nstate=state;
-   EnableTouch();   // enable touch function
 static uint8_t main_state=1;
 static uint8_t state_display=0;
 static uint8_t state_touch=1;
 static uint8_t state_t=1;
 static uint8_t state_r=0;
- float b_voltage=0;
- /*      b_voltage=battery_voltage();
-       //gc.printf("%f \n",  b_voltage );
-       if (b_voltage<3.5)
-       {
-          bat_screen_nocharge();
-          DisableTouch();
-        }
-      
-      
-else
-    {  
-     // enable touch function
-       bat_screen_charge();
-       EnableTouch();*/
+uint8_t battery_voltage_condition=0;
+  
+  
+ DisableTouch();
+ gc.baud(115200);
+ init_screen();    //initialize lcd
+ screen_main(); // display of main screen 
+
+
    while(1)
    {
+           DisableTouch();
+           battery_voltage_condition=battery_voltage();
+    
+   if (battery_voltage_condition==3)
+         {
+             DisableTouch();
+         }
+              
+                         
+  else
+       {             
+    
+     EnableTouch();
      switch(main_state)                          // main state machine
      {
          case 1:  state_display=touch(state_touch);           // touch state 
@@ -120,7 +114,7 @@
                     state_touch=12;  // jumping to touch case 12
                    } 
                  break;    
-                
+        }             
                 
     }
 }
@@ -133,7 +127,7 @@
 uint8_t touch(uint8_t state)
 {
    static  uint8_t state1=0;
-   detect_touch();     // determine the touch points
+   detect_touch(state);     // determine the touch points
     
     switch(state)    // state for touch
   {