Chanel's edits

Dependencies:   max32630fthr USBDevice

Files at this revision

API Documentation at this revision

Comitter:
saleiferis
Date:
Tue Apr 07 04:57:22 2020 +0000
Parent:
17:65a8b29f6bac
Commit message:
HeartRateService

Changed in this revision

bt32630.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/bt32630.h	Wed Mar 18 17:48:18 2020 +0000
+++ b/bt32630.h	Tue Apr 07 04:57:22 2020 +0000
@@ -1,4 +1,4 @@
-//#include "HeartRateService.h"
+#include "HeartRateService.h"
 #include "ECGService.h"
 #include "PPGService.h"
 #include "filters.h"
@@ -45,8 +45,8 @@
 
 
 static int16_t hrmCounter = 100; // init HRM to 100bps
-//static HeartRateService *hrServicePtr;
-extern ECGService *hrServicePtr;
+extern HeartRateService *hrServicePtr;
+//extern ECGService *hrServicePtr;
 
 static EventQueue eventQueue(/* event count */ 16 * EVENTS_EVENT_SIZE);
 
@@ -149,7 +149,7 @@
         int avg_HR = (int)((FS*60)/rravg1);
         pc.printf("%f %f %d %d\n", y/50,(movmean/1000)*outputSignal[current],HR,avg_HR);
         //pc.printf("%f f\n",y,y*(float)outputSignal[current]);
-        hrServicePtr->updateHeartRate(avg_HR);
+        hrServicePtr->updateHeartRate((uint8_t)avg_HR);
         
     }
     
@@ -190,8 +190,8 @@
     ble.gap().onConnection(connectionCallback);
 
     /* Setup primary service. */
-    //hrServicePtr = new HeartRateService(ble, hrmCounter, HeartRateService::LOCATION_FINGER);
-    hrServicePtr = new ECGService(ble, hrmCounter);
+    hrServicePtr = new HeartRateService(ble, (uint8_t)hrmCounter, HeartRateService::LOCATION_FINGER);
+    //hrServicePtr = new ECGService(ble, hrmCounter);
 
     pc.printf("Setup primary service ...\n");
 
--- a/main.cpp	Wed Mar 18 17:48:18 2020 +0000
+++ b/main.cpp	Tue Apr 07 04:57:22 2020 +0000
@@ -28,7 +28,8 @@
 I2C i2c(I2C2_SDA, I2C2_SCL);
 MAX86150 max86150Sensor;
 
-ECGService *hrServicePtr;
+//ECGService *hrServicePtr;
+HeartRateService *hrServicePtr;
 int k; // loop iteration
 float signal[BUFF_SIZE]={0}; //store signal segment to be filtered
 float bp_signal[BUFF_SIZE]={0};