summaryrefslogtreecommitdiff
path: root/tools/wasptool
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-04-17 16:17:24 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-04-17 16:17:24 (GMT)
commitfe43091bcfd2756fe9cab0dc47b7e4da73d8166c (patch)
treef3ba468e91117b5c34582f6113adb589acb68405 /tools/wasptool
parent777a150c9dfb8d18de75d20f841ef34385f3131b (diff)
tools: wasptool: Add support for --reset
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)