From 090d62fa2f60a7a32058fea8d59de742ac1ac036 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 5 May 2012 20:24:13 +0200 Subject: m24cxx: Check write-mode bit Signed-off-by: Michael Buesch --- libtoprammer/chips/m24cxxdip8.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libtoprammer/chips/m24cxxdip8.py') 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 -- cgit v1.2.3