diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-03 19:22:54 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-03 19:22:54 (GMT) |
| commit | a5caa845b792b164915db2acc0a7dddcde426c52 (patch) | |
| tree | 3aca7a5fb2f3b4f96fd6ac3f04cfbecc7a14ff88 /wasp/boards/simulator/machine.py | |
| parent | d0f18a15fad28f80ae3d486df4efd9916b22dc22 (diff) | |
wasp: simulator: Add support for machine.[light|deep]sleep()
Diffstat (limited to 'wasp/boards/simulator/machine.py')
| -rw-r--r-- | wasp/boards/simulator/machine.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wasp/boards/simulator/machine.py b/wasp/boards/simulator/machine.py index 3f8989f..d6d39b7 100644 --- a/wasp/boards/simulator/machine.py +++ b/wasp/boards/simulator/machine.py @@ -1,4 +1,5 @@ import display +import time class Tracer(object): def __init__(self, *args, **kwargs): @@ -66,3 +67,10 @@ class SPI(object): self.sim.write(buf) else: print("Sending data: " + str(buf)) + +def lightsleep(ms=10): + """TODO: This where we should manage the simulated components""" + time.sleep(ms / 1000) + +def deepsleep(ms=10): + lightsleep(ms) |
