def main(): import threading if sys.argv[1] == 'AUTO': print portList() for port in portList(): threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start() time.sleep(5) else: programmer = Stk500v2() programmer.connect(port = sys.argv[1]) programmer.programChip(intelHex.readHex(sys.argv[2])) sys.exit(1)
def main(): """ Entry point to call the stk500v2 programmer from the commandline. """ import threading if sys.argv[1] == 'AUTO': print portList() for port in portList(): threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start() time.sleep(5) else: programmer = Stk500v2() programmer.connect(port = sys.argv[1]) programmer.programChip(intelHex.readHex(sys.argv[2])) sys.exit(1)
def main(): programmer = Stk500v2() if sys.argv[1] == 'AUTO': import _winreg key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM") i=0 while True: values = _winreg.EnumValue(key, i) if 'USBSER' in values[0]: programmer.connect(port = values[1]) break i+=1 else: programmer.connect(port = sys.argv[1]) programmer.programChip(intelHex.readHex(sys.argv[2])) sys.exit(1)
def runProgrammer(port, filename): """ Run an STK500v2 program on serial port 'port' and write 'filename' into flash. """ programmer = Stk500v2() programmer.connect(port=port) programmer.programChip(intelHex.readHex(filename)) programmer.close()
def runProgrammer(port, filename): programmer = Stk500v2() programmer.connect(port = port) programmer.programChip(intelHex.readHex(filename)) programmer.close()
def main(): programmer = Stk500v2() programmer.connect(port=sys.argv[1]) programmer.programChip(intelHex.readHex(sys.argv[2])) sys.exit(1)
def main(): programmer = Stk500v2() programmer.connect(port = sys.argv[1]) programmer.programChip(intelHex.readHex(sys.argv[2])) sys.exit(1)
def main(): programmer = Stk500v2() programmer.connect() programmer.programChip(intelHex.readHex("cfg_4f55234def059.hex")) sys.exit(1)
def runProgrammer(port, filename): """ Run an STK500v2 program on serial port 'port' and write 'filename' into flash. """ programmer = Stk500v2() programmer.connect(port = port) programmer.programChip(intelHex.readHex(filename)) programmer.close()