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)

This commit is contained in:
Dave
2022-03-18 15:03:35 -05:00
committed by GitHub
parent 3fd60760c6
commit 3d101c82d4

View File

@@ -14,6 +14,8 @@ from adafruit_hid.keycode import Keycode
#from keyboard_layout_win_LANG import KeyboardLayout #from keyboard_layout_win_LANG import KeyboardLayout
#from keycode_win_LANG import Keycode #from keycode_win_LANG import Keycode
import supervisor
import time import time
import digitalio import digitalio
from board import * from board import *
@@ -101,9 +103,14 @@ def parseLine(line):
kbd = Keyboard(usb_hid.devices) kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayout(kbd) 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 # sleep at the start to allow the device to be recognized by the host computer
time.sleep(.5) time.sleep(.5)
led.value = True
def getProgrammingStatus(): def getProgrammingStatus():
# check GP0 for setup mode # check GP0 for setup mode
@@ -187,3 +194,9 @@ if(progStatus == False):
print("Done") print("Done")
else: else:
print("Update your payload") print("Update your payload")
while True:
time.sleep(1.0)
led.value = False
time.sleep(1.0)
led.value = True