Chanel's edits

Dependencies:   max32630fthr USBDevice

Revision:
19:f230229cb6f3
Parent:
17:65a8b29f6bac
--- 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");