From: Dan White Date: Sun, 3 Jun 2012 02:13:20 +0000 (-0500) Subject: bugfix flash read/write for off-by-one errors X-Git-Tag: calibrations~59 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=fab76f3b9dba759f163c3692383791618c042b7b;p=430.git bugfix flash read/write for off-by-one errors --- diff --git a/python-lib/mpsse-test.py b/python-lib/mpsse-test.py index d449506..69934ce 100755 --- a/python-lib/mpsse-test.py +++ b/python-lib/mpsse-test.py @@ -292,7 +292,7 @@ if 0: #code space in RAM, only get/send used block of bytes a = [a for a in h.addresses() if (a >= 0x4000 and a < 0xff00)] - alen = max(a) - min(a) + alen = max(a) - min(a) + 1 code = h.gets(0x4000, alen) flash.write(min(a), code) diff --git a/python-lib/usbio.py b/python-lib/usbio.py index f39af29..03c56d9 100644 --- a/python-lib/usbio.py +++ b/python-lib/usbio.py @@ -1168,7 +1168,7 @@ class M25PExx(object): nPages = (n // 256) + 1 for i in range(nPages): s = i * 256 - e = min(s+256, len(data)-1) + e = min(s+256, len(data)) a = addr + s while not self.isReady(): print hex(self.status())