freemyipod r269 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r268‎ | r269 | r270 >
Date:17:56, 22 November 2010
Author:farthen
Status:new
Tags:
Comment:
emBIOS: libembios: bugfix: don't expect an answer after execfirmware.
Modified paths:
  • /embios/trunk/tools/libembios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/libembios.py
@@ -422,7 +422,6 @@
423423 self.execimage(baseaddr)
424424 return Bunch(baseaddr=baseaddr, name=name)
425425
426 -
427426 def bootflashread(self, memaddr, flashaddr, size):
428427 """ Copies the data in the bootflash at 'flashaddr' of the specified size
429428 to the memory at addr 'memaddr'
@@ -437,7 +436,7 @@
438437
439438 def execfirmware(self, addr):
440439 """ Executes the firmware at 'addr' and passes all control to it. """
441 - return self.lib.monitorcommand(struct.pack("IIII", 24, addr, 0, 0), "III", (None, None, None))
 440+ return self.lib.monitorcommand(struct.pack("IIII", 24, addr, 0, 0))
442441
443442 def aesencrypt(self, addr, size, keyindex):
444443 """ Encrypts the buffer at 'addr' with the specified size
@@ -494,7 +493,7 @@
495494 self.connected = True
496495
497496 def monitorcommand(self, cmd, rcvdatatypes=None, rcvstruct=None):
498 - self.dev.cout(cmd)
 497+ writelen = self.dev.cout(cmd)
499498 if rcvdatatypes:
500499 rcvdatatypes = "I" + rcvdatatypes # add the response
501500 data = self.dev.cin(struct.calcsize(rcvdatatypes))
@@ -517,6 +516,8 @@
518517 raise DeviceError("Invalid command! This should NOT happen!")
519518 elif libembiosdata.responsecodes[response] == "busy":
520519 raise DeviceError("Device busy")
 520+ else:
 521+ return writelen
521522
522523
523524 class Dev(object):