1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 08:51:19 +01:00

Merge pull request #11095 from benpicco/pyterm_sleep

pyterm: add /sleep function
This commit is contained in:
benpicco 2020-01-15 18:25:29 +01:00 committed by GitHub
commit 8a99824e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,6 +318,14 @@ class SerCmd(cmd.Cmd):
date = time.strftime("%Y-%m-%d %H:%M:%S")
return ["%s" % (date)]
def do_PYTERM_sleep(self, line):
"""Pyterm command: Sleep for n seconds.
"""
if line:
time.sleep(float(line))
else:
self.logger.error("sleep: missing operand")
def do_PYTERM_reset(self, line):
"""Pyterm command: Send a reset to the node.
"""