File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ bool MotionController::Should_ShakeWake(uint16_t thresh) {
5050 auto diff = xTaskGetTickCount () - lastShakeTime;
5151 lastShakeTime = xTaskGetTickCount ();
5252 int32_t speed = std::abs (y + z - lastYForShake - lastZForShake) / diff * 10 ;
53- if (speed > thresh) {
53+ // (.2 * speed) + ((1 - .2) * accumulatedspeed);
54+ // implemented without floats as .25Alpha
55+ accumulatedspeed = (speed/4 ) + ((accumulatedspeed/4 )*3 );
56+ if (accumulatedspeed > thresh) {
5457 wake = true ;
5558 }
5659 lastXForShake = x;
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ namespace Pinetime {
6565 int16_t lastXForShake = 0 ;
6666 int16_t lastYForShake = 0 ;
6767 int16_t lastZForShake = 0 ;
68+ int32_t accumulatedspeed = 0 ;
6869 uint32_t lastShakeTime = 0 ;
6970 };
7071 }
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ namespace Pinetime {
173173 private:
174174 Pinetime::Controllers::FS& fs;
175175
176- static constexpr uint32_t settingsVersion = 0x0004 ;
176+ static constexpr uint32_t settingsVersion = 0x0003 ;
177177 struct SettingsData {
178178 uint32_t version = settingsVersion;
179179 uint32_t stepsGoal = 10000 ;
@@ -187,7 +187,7 @@ namespace Pinetime {
187187 PineTimeStyle PTS;
188188
189189 std::bitset<4 > wakeUpMode {0 };
190- uint16_t shakeWakeThreshold = 300 ;
190+ uint16_t shakeWakeThreshold = 150 ;
191191 Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium;
192192 };
193193
You can’t perform that action at this time.
0 commit comments