diff options
author | dragonprevost <dragon@dkp.io> | 2018-10-22 17:35:18 -0700 |
---|---|---|
committer | dragonprevost <dragon@dkp.io> | 2018-10-22 17:35:18 -0700 |
commit | fe5acb3679efa12cce6bea126cc642037d005ef3 (patch) | |
tree | 134ff671f8772eb94dadb5adda586bb70d3db0c5 /motionMonitor | |
parent | c5d0a802c38dbc31a784afbd8f10b919c78c28b4 (diff) |
Implented array that holds timestamp of all sudden impacts that are recorded.
Diffstat (limited to 'motionMonitor')
-rw-r--r-- | motionMonitor/motionMonitor.c | 9 |
1 files 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; |