summaryrefslogtreecommitdiff
path: root/src/systemtask
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-03 21:53:27 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-03 21:53:27 (GMT)
commit603d1f38ca3caad0abed2e884bb36504a71b623e (patch)
treec40ac3d66fe6a136887f2314d511136b509c35be /src/systemtask
parent96b982fd94b48e441ab3a582bfafc7410bf0cbb1 (diff)
Read accelerometer at 100 instead of 10 Hz
Diffstat (limited to 'src/systemtask')
-rw-r--r--src/systemtask/SystemTask.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h
index cf15071..bd12005 100644
--- a/src/systemtask/SystemTask.h
+++ b/src/systemtask/SystemTask.h
@@ -140,6 +140,20 @@ namespace Pinetime {
static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000);
SystemMonitor monitor;
+
+ public:
+ inline double ReadGXYZ(double &X, double &Y, double &Z) const {
+ auto motionValues = motionSensor.Process();
+ motionController.Update(motionValues.x, motionValues.y, motionValues.z);
+ X = motionValues.x; Y = motionValues.y; Z = motionValues.z;
+ return std::sqrt(X*X + Y*Y + Z*Z);
+ }
+
+ inline double ReadG() const {
+ double x, y, z;
+ return ReadGXYZ(x,y,z);
+ }
+
};
}
}