Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update goodfet.i2ceeprom #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/goodfet.i2ceeprom
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if len(sys.argv) == 1:
print "%s dump 0x$target $filename.bin [0x$start [0x$length]]" % sys.argv[0]
print "%s read 0x$target [0x$start [0x$length]]" % sys.argv[0]
print "%s write 0x$target 0x$adr 0x$val [0x...]" % sys.argv[0]
print " NOTE: Some chips use 2 address bytes, in this case use:"
print " %s write 0x$target 0x$adrHigh 0x$addrLow 0x$val [0x...]" % sys.argv[0]
print "%s scan" % sys.argv[0]
sys.exit()

Expand Down Expand Up @@ -72,7 +74,7 @@ if sys.argv[1] == "read":
if len(sys.argv) > 4:
count = int(sys.argv[4], 16)
print "Reading %i bytes from device 0x%02x starting at 0x%02x." % (count, devadr, start)
data = []
data = b''
for x in xrange(0, count, 128):
data += client.I2Ctrans(min(128, count - x), [devadr, ((start + x) >> 8) & 0x0ff, (start + x) & 0x0ff])
if data:
Expand Down