From fe5acb3679efa12cce6bea126cc642037d005ef3 Mon Sep 17 00:00:00 2001 From: dragonprevost Date: Mon, 22 Oct 2018 17:35:18 -0700 Subject: Implented array that holds timestamp of all sudden impacts that are recorded. --- motionMonitor/motionMonitor.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/motionMonitor/motionMonitor.c b/motionMonitor/motionMonitor.c index cc05a0c..0f2771a 100644 --- a/motionMonitor/motionMonitor.c +++ b/motionMonitor/motionMonitor.c @@ -19,6 +19,7 @@ typedef struct{ double xAccImpact [N_CHANGE_BLOCKS]; double yAccImpact [N_CHANGE_BLOCKS]; double zAccImpact [N_CHANGE_BLOCKS]; +uint64_t timestamps [N_CHANGE_BLOCKS]; @@ -94,17 +95,13 @@ void recordImpact(double* xAcc, double* zAcc){ //time = (unsigned long)time(NULL) - + timestamps[totalImpacts] = (unsigned long)time(NULL); xAccImpact[totalImpacts] = *xAcc; yAccImpact[totalImpacts] = *yAcc; zAccImpact[totalImpacts] = *zAcc; totalImpacts++; LE_INFO("New Impact, totalImpacts: %d", totalImpacts); - - for(int i = 0; i < totalImpacts; i++){ - LE_INFO("ImpactOf X: %f Y: %f Z: %f ", xAccImpact[i], yAccImpact[i], zAccImpact[i]); - } } /* @@ -124,8 +121,6 @@ le_result_t brnkl_motion_getSuddenImpact(double* xAcc, size_t *xSize, yAcc = yAccImpact; zAcc = zAccImpact; - //Flush Arrays - totalImpacts = 0; return LE_OK; -- cgit v1.2.3