Added 4 point or 8 point averaging function .

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_3rd_nov_2017 by nikita teggi

Revision:
57:a366af1ddd7b
Parent:
53:cc6e65480a67
--- a/sdcard.cpp	Fri Nov 03 07:16:44 2017 +0000
+++ b/sdcard.cpp	Fri Dec 15 09:41:06 2017 +0000
@@ -335,6 +335,28 @@
         snd.printf("\nPPG file delete : Successful");   // Checks for SUCCESS
     else 
         snd.printf("\nPPG file delete : UnSuccessful");
+     
+     //Added by rohit ////////////   
+    status = 1 ;
+    sprintf(buffer3, "/sd/%d_BP_ECG_avg.csv",pid);
+    status = remove(buffer3);                           //Removes PPG file of BP and updates status with 0 if successful
+    
+    if( status == 0 )
+        snd.printf("\nECG_AVG file delete : Successful");   // Checks for SUCCESS
+    else 
+        snd.printf("\nECG_AVG file delete : UnSuccessful");   
+        
+        
+    status = 1 ;
+    sprintf(buffer3, "/sd/%d_BP_PPG_avg.csv",pid);
+    status = remove(buffer3);                           //Removes PPG file of BP and updates status with 0 if successful
+    
+    if( status == 0 )
+        snd.printf("\nPPG_AVG file delete : Successful");   // Checks for SUCCESS
+    else 
+        snd.printf("\nPPG_AVG file delete : UnSuccessful");   
+            
+    ////////////////////////////////////////////////////////////////    
        
 }
 
@@ -472,15 +494,31 @@
 void delete_subfiles(uint32_t pid)
 {
     char buffer3[32];  
-    int success1 , success2, success3;
+    int success1 , success2, success3,success4;
     success1 = 1 ;
     sprintf(buffer3, "/sd/%d_BP.csv", pid);
     success1 = remove(buffer3);                           //Removes PPG file of BP and updates status with 0 if successful
-    
     if( success1 == 0 )
         snd.printf("\nBP file delete : Successful");   // Checks for SUCCESS
     else 
         snd.printf("\nBP file delete : UnSuccessful");
+///////////////// Added by rohit /////////////////
+     success4 = 1;
+    sprintf(buffer3, "/sd/%d_BP_ECG_avg.csv", pid);
+    success4 = remove(buffer3);
+    if (success4 == 0)
+    snd.printf("\nBP_ECG_AVG file delete : Successful");
+    else
+    snd.printf("\nBP_ECG_AVG file delete : UnSuccessful");
+    
+    success4 = 1;
+    sprintf(buffer3, "/sd/%d_BP_PPG_avg.csv", pid);
+    success4 = remove(buffer3);
+    if (success4 == 0)
+    snd.printf("\nBP_PPG_AVG file delete : Successful");
+    else
+    snd.printf("\nBP_PPG_AVG file delete : UnSuccessful");
+   ///////////////////////////// 
 
     success2 = 1 ;
     sprintf(buffer3, "/sd/%d_GLC.csv", pid);
@@ -650,7 +688,7 @@
         for(uint16_t file_start=0;file_start<sample;file_start++)                                       //reading the raw data
                         {     
                             fread(buf,sizeof(uint32_t),1,fp_read_sdcard_file);
-                            snd.printf("%08x\n", buf[0]);
+                            snd.printf("%d\n", buf[0]);
                         }
       /* switch(sample)
             {