summaryrefslogtreecommitdiff
path: root/tools/wasptool
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wasptool')
-rwxr-xr-xtools/wasptool14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/wasptool b/tools/wasptool
index bf60e9b..34fc97d 100755
--- a/tools/wasptool
+++ b/tools/wasptool
@@ -104,6 +104,14 @@ def handle_exec(c, fname):
if not verbose:
c.logfile = None
+def handle_reset(c):
+ c.send('\x05')
+ c.expect('=== ')
+ c.sendline('import machine')
+ c.sendline('machine.reset()')
+ c.expect('=== ')
+ c.send('\x04')
+
def handle_rtc(c):
# Wait for the clock to tick over to the next second
now = then = time.localtime()
@@ -142,6 +150,8 @@ if __name__ == '__main__':
help='Execute the contents of a file')
parser.add_argument('--eval',
help='Execute the provided python string')
+ parser.add_argument('--reset', action='store_true',
+ help="Reboot the device (and don't stay in bootloader mode)")
parser.add_argument('--rtc', action='store_true',
help='Set the time on the WASP device')
parser.add_argument('--upload',
@@ -178,4 +188,8 @@ if __name__ == '__main__':
console.close()
os.execl(pynus, pynus)
+ if args.reset:
+ handle_reset(console)
+ sys.exit(0)
+
unsync(console)