diff options
Diffstat (limited to 'src/systemtask/SystemTask.h')
| -rw-r--r-- | src/systemtask/SystemTask.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index c5b0379..f141b01 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -35,7 +35,7 @@ #include "drivers/Watchdog.h" #include "systemtask/Messages.h" -extern std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> NoInit_BackUpTime; +extern std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds> NoInit_BackUpTime; namespace Pinetime { namespace Drivers { class Cst816S; @@ -118,7 +118,9 @@ namespace Pinetime { Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::MotorController& motorController; Pinetime::Drivers::Hrs3300& heartRateSensor; + public: Pinetime::Drivers::Bma421& motionSensor; + private: Pinetime::Controllers::Settings& settingsController; Pinetime::Controllers::HeartRateController& heartRateController; Pinetime::Controllers::MotionController& motionController; @@ -149,6 +151,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); + } + }; } } |
