diff --git a/wasp/wasp.py b/wasp/wasp.py index 97eec79..d3a1a8d 100644 --- a/wasp/wasp.py +++ b/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