10000 PewPew M4: improve reload on holding Z button · python-ugame/circuitpython-stage@19a66d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19a66d7

Browse files
committed
PewPew M4: improve reload on holding Z button
1 parent b05e195 commit 19a66d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pewpew_m4/ugame.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import digitalio
33
import gamepad
44
import stage
5+
import supervisor
56
import time
67

78

@@ -34,9 +35,8 @@ def get_pressed(self):
3435
if buttons & K_Z:
3536
now = time.monotonic()
3637
if self.last_z_press:
37-
if now - self.last_z_press > 5:
38-
import microcontroller
39-
microcontroller.reset()
38+
if now - self.last_z_press > 2:
39+
supervisor.reload()
4040
else:
4141
self.last_z_press = now
4242
else:

0 commit comments

Comments
 (0)
0