X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=pyfrprog.git;a=blobdiff_plain;f=frprog.py;fp=frprog.py;h=ab8aba66bc8b71c869829e6c379fa1ed9fdc2cee;hp=0ca52c57de1fd788e5b06f4af00be107e0549c6d;hb=fabfc9c00a17e8eb37ee24d752900e58ea61fe78;hpb=3853f618d9e80f804be48fddb61662fd8efe6b7c diff --git a/frprog.py b/frprog.py index 0ca52c5..ab8aba6 100755 --- a/frprog.py +++ b/frprog.py @@ -2,8 +2,6 @@ import sys, time from SerialPort_linux import * -# serial device to communicate with -DEVICE="/dev/ttyUSB0" # baudrate used for initialization INIT_BAUDRATE=9600 # baudrate used for communication with the internal bootloader after init @@ -183,10 +181,15 @@ def main(argv=None): # check command line arguments if argv is None: argv = sys.argv - if len(argv) != 2: - print "Usage: " + argv[0] + " [target mhx-file]" + if len(argv) != 2 and len(argv) != 4: + print "Usage: " + argv[0] + " [-d DEVICE]" return 1 + # standard serial device to communicate with + DEVICE="/dev/ttyUSB0" + if len(argv) == 4: + DEVICE = argv[3] + # read in data from mhx-files before starting try: try: