Changes done in ECG and BT

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Revision:
42:c81673b04b6a
Parent:
41:1141a75eacc4
Child:
43:85a7f399cb9d
--- a/sdcard.cpp	Fri Sep 08 10:35:21 2017 +0000
+++ b/sdcard.cpp	Mon Sep 11 10:02:46 2017 +0000
@@ -345,7 +345,7 @@
 {
     char buffer3[32];
     sprintf(buffer3, "/sd/%d.csv", pid);            //Printing file path to the buffer
-    if(get_filecreated_status())                    //if file created open in append mode
+    if(get_filecreated_status() == true)                    //if file created open in append mode
     {
         fpmain = fopen(buffer3, "a");               // open the file PID.csv with FILE pointer fpmain
         snd.printf("\n Append mode\n");
@@ -526,14 +526,14 @@
 
 void sd_read(uint32_t  *pid_btpid)          //reading the data from the openend file
  {
-    FILE *fp; FILE *fp1;
+    FILE *fp;
     uint32_t pid[2]={1,1};
     fp= fopen("/sd/pid_info.txt","r");
      if (fp==NULL)
     {
-       fp1= fopen("/sd/pid_info.txt","w");
-       fwrite(&pid, sizeof(uint32_t),2,fp1);
-       fclose(fp1);
+       fp= fopen("/sd/pid_info.txt","w");
+       fwrite(&pid, sizeof(uint32_t),2,fp);
+       fclose(fp);
        fp= fopen("/sd/pid_info.txt","r");
     }
      
@@ -552,15 +552,4 @@
      
 }
 
-void increment_pid (void)                       //increment pid if a test is completed
-{
-    uint32_t pid[2];
-    if(!get_filecreated_status())               //if file is in write mode                       
-    {
-        set_filecreated_status();               //set it to make it append mode
-        sd_read(pid);                           //read pid from sd card
-        pid[0] = pid[0] + 1;                    //increment it by 1
-        sd_write(pid);                          //write it back to sd card
-    }
-    
-}     
\ No newline at end of file
+    
\ No newline at end of file