From: theStack Date: Sun, 13 Dec 2009 07:08:53 +0000 (+0100) Subject: flashing will be done now in a simple loop X-Git-Tag: v0.1~50 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=pyfrprog.git;a=commitdiff_plain;h=b9fee154b7467b52b9c17f3f4d98c7a9b26e82ea flashing will be done now in a simple loop --- diff --git a/frprog.py b/frprog.py index f6a7418..cc25005 100755 --- a/frprog.py +++ b/frprog.py @@ -118,6 +118,7 @@ class FlashSequence(object): self.address = address self.data = data +# list of all our address/data pairs to flash flashseqs = [] # check command line arguments @@ -164,6 +165,7 @@ print "The following flash sequences have been read in:" for seq in flashseqs: print hex(seq.address) + ":", seq.data + print "Initializing serial port..." tty = SerialPort(DEVICE, 100, INIT_BAUDRATE) @@ -184,7 +186,14 @@ print "OK, trying to set baudrate..." cmdBAUDRATE(REAL_BAUDRATE) tty = SerialPort(DEVICE, 100, REAL_BAUDRATE) +# let the fun begin! +for seq in flashseqs: + print "Flashing", len(seq.data), "bytes at address", hex(seq.address) + cmdWRITE(seq.address, len(seq.data), seq.data) +sys.exit(0) + +# some tests here....... """ # execute (existing) program in ram cmdCALL(0x00033ffc)