Modification into 17th July New display demo code

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Ext_Demo_17July2017_newdis by SenseSemi

Revision:
31:0f67acfc6236
Parent:
26:53ff13a164f3
Child:
32:76892fdf5e4c
--- a/ecgg.cpp	Sat Jul 08 12:06:16 2017 +0000
+++ b/ecgg.cpp	Sat Jul 15 05:39:45 2017 +0000
@@ -258,23 +258,33 @@
  
  fclose(fpeecg1);
  pc.printf("temporary file closed\n"); 
-BLEMsg_info_ecg.cal_data.cal_sbp_dummy = 0;
-BLEMsg_info_ecg.cal_data.cal_dbp_OTtyp = HR1;  //To be modified after HR code is added. 
+ 
+if(HR_avg>100 || HR_avg<40) 
+    {
+        
+        return 1;               // out of range condition returning 1  //nikita//10/7
+        
+        }
+ else 
+     {
+ 
+        BLEMsg_info_ecg.cal_data.cal_sbp_dummy = 0;
+        BLEMsg_info_ecg.cal_data.cal_dbp_OTtyp = HR1;  //To be modified after HR code is added. 
 
-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
+        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
 
-pc.printf("Closed the main file\n");
+        pc.printf("Closed the main file\n");
  
  
  
   //return HR1;
- return HR_avg; 
-  
+        return HR_avg; 
+  }
 }          
  else 
      {
-        pc.printf("no - leadoff");
+        pc.printf("improper lead connection");
         return 0;
     } 
 pc.printf("closing temporary file\n");