We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c925c62 commit 5269885Copy full SHA for 5269885
src/components/motion/MotionController.cpp
@@ -40,17 +40,14 @@ bool MotionController::ShouldWakeUp(bool isSleeping) {
40
return false;
41
}
42
bool MotionController::ShouldSleep(bool isSleeping) {
43
- if (not isSleeping) {
44
- if (y <= 0) {
45
- lastYForSleep = 0;
46
- return false;
47
- }
48
- if (y - 230 > lastYForSleep) {
49
- lastYForSleep = y;
50
- return true;
51
52
53
+ bool ret = false;
+
+ if (y >= lastYForSleep + 192 && !isSleeping)
+ ret = true;
+ lastYForSleep = (y > 320) ? y : 320;
+ return ret;
54
55
56
void MotionController::IsSensorOk(bool isOk) {
0 commit comments