From 3d101c82d474fff8ddaaeb2d6f8ad118dc3417bb Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 18 Mar 2022 15:03:35 -0500 Subject: [PATCH] Disable auto reload when a new payload or code is deployed. Add blinking LED when board is idle, ready for reload or payload is finished running (#59) --- duckyinpython.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/duckyinpython.py b/duckyinpython.py index 09fddf2..9112537 100644 --- a/duckyinpython.py +++ b/duckyinpython.py @@ -14,6 +14,8 @@ from adafruit_hid.keycode import Keycode #from keyboard_layout_win_LANG import KeyboardLayout #from keycode_win_LANG import Keycode +import supervisor + import time import digitalio from board import * @@ -101,9 +103,14 @@ def parseLine(line): kbd = Keyboard(usb_hid.devices) layout = KeyboardLayout(kbd) +# turn off automatically reloading when files are written to the pico +supervisor.disable_autoreload() + # sleep at the start to allow the device to be recognized by the host computer time.sleep(.5) +led.value = True + def getProgrammingStatus(): # check GP0 for setup mode @@ -187,3 +194,9 @@ if(progStatus == False): print("Done") else: print("Update your payload") + +while True: + time.sleep(1.0) + led.value = False + time.sleep(1.0) + led.value = True