summaryrefslogtreecommitdiff
path: root/tests/extmod/machine_timer.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/machine_timer.py')
-rw-r--r--tests/extmod/machine_timer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/extmod/machine_timer.py b/tests/extmod/machine_timer.py
index b7e6a280f..c9a47c402 100644
--- a/tests/extmod/machine_timer.py
+++ b/tests/extmod/machine_timer.py
@@ -2,6 +2,7 @@
try:
import utime, umachine as machine
+
machine.Timer
except:
print("SKIP")
@@ -27,11 +28,11 @@ t2.deinit()
t.deinit()
# create one-shot timer with callback and wait for it to print (should be just once)
-t = machine.Timer(period=1, mode=machine.Timer.ONE_SHOT, callback=lambda t:print('one-shot'))
+t = machine.Timer(period=1, mode=machine.Timer.ONE_SHOT, callback=lambda t: print("one-shot"))
utime.sleep_ms(5)
t.deinit()
# create periodic timer with callback and wait for it to print
-t = machine.Timer(period=4, mode=machine.Timer.PERIODIC, callback=lambda t:print('periodic'))
+t = machine.Timer(period=4, mode=machine.Timer.PERIODIC, callback=lambda t: print("periodic"))
utime.sleep_ms(14)
t.deinit()