Merge pull request #118 from FintasticMan/fix_lower_sleep

lowersleep: Fix InfiniSim build
This commit is contained in:
NeroBurner 2023-08-30 13:31:21 +02:00 committed by GitHub
commit 3ae396c0a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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:

View File

@ -46,6 +46,7 @@ namespace Pinetime {
bool ShouldShakeWake(uint16_t thresh);
bool ShouldRaiseWake() const;
bool ShouldLowerSleep() const;
int32_t CurrentShakeSpeed() const {
return accumulatedSpeed;