Add missing conditionals for raise-to-wake
This commit is contained in:
parent
d3846be32d
commit
04380f9362
14
wasp/wasp.py
14
wasp/wasp.py
|
@ -24,12 +24,13 @@ import widgets
|
|||
|
||||
from apps.launcher import LauncherApp
|
||||
from apps.pager import PagerApp, CrashApp, NotificationApp
|
||||
from micropython import const
|
||||
|
||||
RAISE_WAKE_Y_SWITCH_THRESHOLD = -1536
|
||||
RAISE_WAKE_SPEED_MODIFIER = 8
|
||||
RAISE_WAKE_X_THRESHOLD = 512
|
||||
RAISE_WAKE_Y_THRESHOLD = 0
|
||||
RAISE_WAKE_REQUIRED_SPEED = 512
|
||||
RAISE_WAKE_Y_SWITCH_THRESHOLD = const(-768)
|
||||
RAISE_WAKE_SPEED_MODIFIER = const(8)
|
||||
RAISE_WAKE_X_THRESHOLD = const(512)
|
||||
RAISE_WAKE_Y_THRESHOLD = const(0)
|
||||
RAISE_WAKE_REQUIRED_SPEED = const(256)
|
||||
|
||||
class EventType():
|
||||
"""Enumerated interface actions.
|
||||
|
@ -519,6 +520,9 @@ class Manager():
|
|||
self.raise_wake_last_y = y
|
||||
self.raise_wake_last_z = z
|
||||
|
||||
if abs(x) > RAISE_WAKE_X_THRESHOLD or y > RAISE_WAKE_Y_THRESHOLD:
|
||||
return False
|
||||
|
||||
if y < RAISE_WAKE_Y_SWITCH_THRESHOLD:
|
||||
return delta_z > RAISE_WAKE_REQUIRED_SPEED
|
||||
|
||||
|
|
Loading…
Reference in New Issue