From d7dee492018eb0708406d09384f9fc2abbc72ab7 Mon Sep 17 00:00:00 2001 From: FintasticMan Date: Wed, 30 Aug 2023 11:48:23 +0200 Subject: [PATCH] lowersleep: Fix InfiniSim build --- sim/components/motion/MotionController.cpp | 15 +++++++++++++++ sim/components/motion/MotionController.h | 1 + 2 files changed, 16 insertions(+) diff --git a/sim/components/motion/MotionController.cpp b/sim/components/motion/MotionController.cpp index 4309c51..9404339 100644 --- a/sim/components/motion/MotionController.cpp +++ b/sim/components/motion/MotionController.cpp @@ -117,6 +117,21 @@ bool MotionController::ShouldShakeWake(uint16_t thresh) { // return accumulatedSpeed > thresh; } +bool MotionController::ShouldLowerSleep() const { + return false; +// if (stats.yMean < 724 || DegreesRolled(stats.yMean, stats.zMean, stats.prevYMean, stats.prevZMean) < 30) { +// return false; +// } +// +// for (uint8_t i = AccelStats::numHistory + 1; i < yHistory.Size(); i++) { +// if (yHistory[i] < 265) { +// return false; +// } +// } +// +// return true; +} + void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) { switch (types) { case Drivers::Bma421::DeviceTypes::BMA421: diff --git a/sim/components/motion/MotionController.h b/sim/components/motion/MotionController.h index 00b7474..3908d9c 100644 --- a/sim/components/motion/MotionController.h +++ b/sim/components/motion/MotionController.h @@ -46,6 +46,7 @@ namespace Pinetime { bool ShouldShakeWake(uint16_t thresh); bool ShouldRaiseWake() const; + bool ShouldLowerSleep() const; int32_t CurrentShakeSpeed() const { return accumulatedSpeed;