mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
pyterm: add /sleep function
The init_cmd feature is quite handy for automated pyterm runs but there is no delay between the commands that are executed. This adds a /sleep function that can be added between init_cmd commands to prevent them from overflowing the RX buffer on the target.
This commit is contained in:
parent
d29d336894
commit
e12f1f2ff8
8
dist/tools/pyterm/pyterm
vendored
8
dist/tools/pyterm/pyterm
vendored
@ -303,6 +303,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.
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user