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:
43:85a7f399cb9d
Parent:
42:c81673b04b6a
Child:
51:1a4693774b60
--- a/ecgg.cpp	Mon Sep 11 10:02:46 2017 +0000
+++ b/ecgg.cpp	Mon Sep 11 13:09:29 2017 +0000
@@ -14,7 +14,7 @@
 #include "ec_bp.h"
 #include "eeprom_pgm.h"
 #include "struct.h"  // Added on 31/5/17_Nidhin
-
+#include "main.h"
 //#include "test_type.h" //Added on  31/5/17_Nidhin
 
 #define MAX_HR_THRESHOLD 205
@@ -25,7 +25,7 @@
 Serial pc(USBTX,USBRX);  
 
 
-uint16_t ecg(int32_t pid) 
+uint16_t ecg(uint32_t pid) 
 //float ecg(int pid) 
  {
     
@@ -248,6 +248,11 @@
 
         structure_file(ptr_BLEMsg_info_ecg, pid);           //copy the ECG structure to Main file  //COMMENTED Nidhin 10/6/2017 
         ecgfile_mainfile(pid);                              // copy raw data to the main file and ECG file is cleared. //COMMENTED Nidhin 10/6/2017
+        if(get_filecreated_status() == false)                           //if file is in write mode 
+        {   
+            set_filecreated_status();                    
+            increment_filepid (); 
+        } 
         pc.printf("Closed the main file\n");
         return HR_avg; 
   }