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:
43:85a7f399cb9d
Parent:
42:c81673b04b6a
Child:
57:a366af1ddd7b
--- a/bp.cpp	Mon Sep 11 10:02:46 2017 +0000
+++ b/bp.cpp	Mon Sep 11 13:09:29 2017 +0000
@@ -15,6 +15,7 @@
 #include "ec_bp.h"
 #include "bp.h"
 #include "display_modules.h"
+#include "main.h"
 
 
 #define MAX_SBP_THRESHOLD 300
@@ -41,7 +42,7 @@
 uint16_t ebp = 0;      // variable for LOOP operation to read value from File i == ECG , j == PPG
 uint16_t pbp = 0;  //int to uint16_t-Suhasini-21stJuly2017
 
-void bp(int32_t pid) {
+void bp(uint32_t pid) {
     
     uint8_t uch_dummy;
     uint32_t ppgdata; 
@@ -226,7 +227,12 @@
         structure_file(ptr_BLEMsg_info_bp, pid);            // Copy BP structure to main file
         bpfile_mainfile(pid);
         screen_bp1(SBP,DBP);
-      }
+        if(get_filecreated_status() == false)                           //if file is in write mode 
+        {   
+            set_filecreated_status();                    
+            increment_filepid (); 
+        } 
+    }
   }  //Added Nidhin 16/6/17  
   
   else  //Added Nidhin 16/6/17