diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/motion/MotionController.cpp | 22 | ||||
| -rw-r--r-- | src/components/motion/MotionController.h | 6 | ||||
| -rw-r--r-- | src/components/settings/Settings.h | 16 |
3 files changed, 1 insertions, 43 deletions
diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp index aa2f3ee..0404e3f 100644 --- a/src/components/motion/MotionController.cpp +++ b/src/components/motion/MotionController.cpp @@ -31,28 +31,6 @@ bool MotionController::Should_RaiseWake(bool isSleeping) { return false; } -bool MotionController::Should_ShakeWake(uint16_t thresh) { - bool wake = false; - auto diff = xTaskGetTickCount() - lastShakeTime; - lastShakeTime = xTaskGetTickCount(); - /* Currently Polling at 10hz, If this ever goes faster scalar and EMA might need adjusting */ - int32_t speed = std::abs(z + (y / 2) + (x / 4) - lastYForShake - lastZForShake) / diff * 100; - //(.2 * speed) + ((1 - .2) * accumulatedspeed); - // implemented without floats as .25Alpha - accumulatedspeed = (speed / 5) + ((accumulatedspeed / 5) * 4); - - if (accumulatedspeed > thresh) { - wake = true; - } - lastXForShake = x / 4; - lastYForShake = y / 2; - lastZForShake = z; - return wake; -} -int32_t MotionController::currentShakeSpeed() { - return accumulatedspeed; -} - void MotionController::IsSensorOk(bool isOk) { isSensorOk = isOk; } diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index 5200b41..a56991a 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -25,9 +25,7 @@ namespace Pinetime { return z; } - bool Should_ShakeWake(uint16_t thresh); bool Should_RaiseWake(bool isSleeping); - int32_t currentShakeSpeed(); void IsSensorOk(bool isOk); bool IsSensorOk() const { return isSensorOk; @@ -47,11 +45,7 @@ namespace Pinetime { bool isSensorOk = false; DeviceTypes deviceType = DeviceTypes::Unknown; - int16_t lastXForShake = 0; - int16_t lastYForShake = 0; - int16_t lastZForShake = 0; int32_t accumulatedspeed = 0; - uint32_t lastShakeTime = 0; }; } }
\ No newline at end of file diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 8a32efa..5201b77 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -13,7 +13,6 @@ namespace Pinetime { SingleTap = 0, DoubleTap = 1, RaiseWrist = 2, - Shake = 3, }; enum class Colors : uint8_t { White, @@ -96,18 +95,6 @@ namespace Pinetime { return settings.screenTimeOut; }; - void SetShakeThreshold(uint16_t thresh){ - if(settings.shakeWakeThreshold != thresh){ - settings.shakeWakeThreshold = thresh; - settingsChanged = true; - } - - } - - int16_t GetShakeThreshold() const{ - return settings.shakeWakeThreshold; - } - void setWakeUpMode(WakeUpMode wakeUp, bool enabled) { if (enabled != isWakeUpModeOn(wakeUp)) { settingsChanged = true; @@ -148,7 +135,7 @@ namespace Pinetime { }; private: - static constexpr uint32_t settingsVersion = 0x4011; // infinitime redux settings + static constexpr uint32_t settingsVersion = 0x4021; // infinitime redux settings struct SettingsData { uint32_t version = settingsVersion; uint32_t screenTimeOut = 15000; @@ -159,7 +146,6 @@ namespace Pinetime { uint8_t clockFace = 0; std::bitset<4> wakeUpMode {0}; - uint16_t shakeWakeThreshold = 150; Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium; }; |
