summaryrefslogtreecommitdiffstats
path: root/libtoprammer/chips/m24cxxdip8.py
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-05-05 20:24:13 +0200
committerMichael Buesch <m@bues.ch>2012-05-05 20:24:13 +0200
commit090d62fa2f60a7a32058fea8d59de742ac1ac036 (patch)
treeda7f48b9998a616fcabb6ff7debc9f9b5f9c1dc7 /libtoprammer/chips/m24cxxdip8.py
parentd2d62e3914fb2fc6e29361c8c0f43fa095f13ee8 (diff)
downloadtoprammer-090d62fa2f60a7a32058fea8d59de742ac1ac036.tar.xz
toprammer-090d62fa2f60a7a32058fea8d59de742ac1ac036.zip
m24cxx: Check write-mode bit
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/chips/m24cxxdip8.py')
-rw-r--r--libtoprammer/chips/m24cxxdip8.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libtoprammer/chips/m24cxxdip8.py b/libtoprammer/chips/m24cxxdip8.py
index 6a813a5..63502c5 100644
--- a/libtoprammer/chips/m24cxxdip8.py
+++ b/libtoprammer/chips/m24cxxdip8.py
@@ -48,6 +48,7 @@ class Chip_m24cXXdip8_common(Chip):
self.top.cmdEnableZifPullups(True)
self.currentAddrExt = None
+ self.currentWriteMode = None
def erase(self):
self.writeEEPROM("\xFF" * self.eepromSize)
@@ -118,8 +119,10 @@ class Chip_m24cXXdip8_common(Chip):
sizeMask = self.eepromSize - 1
assert(sizeMask & ~0x7FF == 0)
addrExt = address & 0x700 & sizeMask
- if self.currentAddrExt != addrExt:
+ if self.currentAddrExt != addrExt or\
+ self.currentWriteMode != writeMode:
self.currentAddrExt = addrExt
+ self.currentWriteMode = writeMode
if sizeMask & 0x0100:
E0 = addrExt & 0x0100
E0_en = 0
bues.ch cgit interface