From c0eeb5e0e557e481dbc49c9b8473b2e7b05afd74 Mon Sep 17 00:00:00 2001 From: Dan White Date: Mon, 4 Jun 2012 11:54:25 -0500 Subject: [PATCH] flash wip --- python-lib/mpsse-test.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/python-lib/mpsse-test.py b/python-lib/mpsse-test.py index 4fb28c7..c66acdc 100755 --- a/python-lib/mpsse-test.py +++ b/python-lib/mpsse-test.py @@ -276,7 +276,7 @@ if 0: ############################################################################## # Flash testing # -if 1: +if 0: flash = usbio.M25PExx(spi0) flash.power(True) print flash.status() @@ -313,21 +313,21 @@ if 1: while not flash.isReady(): print 'waiting...' -if 1: - nread = 0 - c2 = '' - while nread < len(code): - nr = min(256, len(code)-nread) - c = flash.read(0x4000 + nread, nr) - c2 += c - print 'read: %06x %s' % (0x4000+nread, str2hex(c)) - nread += nr - - print len(code), len(c2) - for i in range(len(code)): - print i, code[i] == c2[i] - print len(code), len(c2) - print str2hex(code[-4:]), str2hex(c2[-4:]) + if 1: + nread = 0 + c2 = '' + while nread < len(code): + nr = min(256, len(code)-nread) + c = flash.read(0x4000 + nread, nr) + c2 += c + print 'read: %06x %s' % (0x4000+nread, str2hex(c)) + nread += nr + + print len(code), len(c2) + for i in range(len(code)): + print i, code[i] == c2[i] + print len(code), len(c2) + print str2hex(code[-4:]), str2hex(c2[-4:]) ############################################################################## -- 2.25.1