Skip to content

Commit

Permalink
lowersleep: Fix InfiniSim build
Browse files Browse the repository at this point in the history
  • Loading branch information
FintasticMan committed Aug 30, 2023
1 parent 0dd9c5e commit d7dee49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sim/components/motion/MotionController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions sim/components/motion/MotionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace Pinetime {

bool ShouldShakeWake(uint16_t thresh);
bool ShouldRaiseWake() const;
bool ShouldLowerSleep() const;

int32_t CurrentShakeSpeed() const {
return accumulatedSpeed;
Expand Down

0 comments on commit d7dee49

Please sign in to comment.