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

Files at this revision

API Documentation at this revision

Comitter:
nidhinvarghese
Date:
Fri Jun 09 08:45:30 2017 +0000
Parent:
16:8fa1d7fd7953
Child:
18:20679eaa54d1
Commit message:
ECG code hanging but BP and GLC working

Changed in this revision

ecgg.cpp Show annotated file Show diff for this revision Revisions of this file
glc.cpp Show annotated file Show diff for this revision Revisions of this file
sdcard.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/ecgg.cpp	Tue Jun 06 11:14:03 2017 +0000
+++ b/ecgg.cpp	Fri Jun 09 08:45:30 2017 +0000
@@ -103,7 +103,7 @@
     
  //   int32_t sample_sum; // static int32_t avg[1500];
     int32_t count = 0; int32_t fs = 500; 
-    uint32_t ecg_buf[N_ECG];
+    uint32_t ecg_buf[N_ECG]; // Moved out of func() Nidhin 9/6/17
     Timer t;
     
     //------------------ Declaration for Peak value detection ------------------------------------
--- a/glc.cpp	Tue Jun 06 11:14:03 2017 +0000
+++ b/glc.cpp	Fri Jun 09 08:45:30 2017 +0000
@@ -215,7 +215,7 @@
 //unsigned int data_diff = 0;
 unsigned char err = 0;
 
-uint16_t glcraw[2]; // Nidhin 31/5/2017
+uint32_t glcraw[2]; // Nidhin 31/5/2017
 uint8_t chk_glc_data = 0;
 
 Serial ble(PTC4,PTC3);
@@ -274,7 +274,7 @@
     
     else
 {
-        gtc.printf("err=1\n");
+       // gtc.printf("err=1\n"); Commented Nidhin 8/6/2017
         
         // lcd1.Print( " ERROR RESULT", 5,220,COLOR_RED,COLOR_BLACK, 0);    
          //  ble.printf("E:");
@@ -417,14 +417,17 @@
                         wait_ms(800);          
                     }
                     
-                      gtc.printf("mgdl is - %d\n", mgdll);
+                      //gtc.printf("mgdl is - %d\n", mgdll);
             } 
         wait(2.25);
         gtc.printf("DATA1 is - %d\n", data1n); 
         gtc.printf("DATA2 is - %d\n", data2n);  
         gtc.printf("mgdl is - %d\n", mgdll);   
         
-       // sd_glcwrite(glcraw, pid);  //Writes the raw data into GLC file 
+        glcraw[0] = (uint32_t)data1n;
+        glcraw[1] = (uint32_t)data2n;
+        
+       sd_glcwrite(glcraw, pid);  //Writes the raw data into GLC file 
  
         //Results Stored to Bluetooth structure 
         BLEMsg_info_glc.cal_data.cal_sbp_dummy = 0;
--- a/sdcard.cpp	Tue Jun 06 11:14:03 2017 +0000
+++ b/sdcard.cpp	Fri Jun 09 08:45:30 2017 +0000
@@ -474,7 +474,7 @@
     sprintf(buffer3, "/sd/%d_GLC.csv", pid);  // BG file is opened in read mode
     fpbg = fopen(buffer3, "r");
     
-    for(int i=0; i<2; i++)
+    for(int i=0; i<1; i++)
     {
     int bigbuf[2] = {0} ;
     fread(bigbuf, sizeof(int),2 , fpbg);