diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-03 21:53:27 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-03 21:53:27 (GMT) |
| commit | 603d1f38ca3caad0abed2e884bb36504a71b623e (patch) | |
| tree | c40ac3d66fe6a136887f2314d511136b509c35be /src/systemtask/SystemTask.h | |
| parent | 96b982fd94b48e441ab3a582bfafc7410bf0cbb1 (diff) | |
Read accelerometer at 100 instead of 10 Hz
Diffstat (limited to 'src/systemtask/SystemTask.h')
| -rw-r--r-- | src/systemtask/SystemTask.h | 14 |
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); + } + }; } } |
