Subversion Repositories freemyipod

Rev

Rev 891 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 891 Rev 892
Line 177... Line 177...
177
    @command()
177
    @command()
178
    def write(self, addr, data):
178
    def write(self, addr, data):
179
        """ Writes the data in 'data' to the location 'addr'
179
        """ Writes the data in 'data' to the location 'addr'
180
            in the memory of the device. This takes care of splitting long requests.
180
            in the memory of the device. This takes care of splitting long requests.
181
        """
181
        """
-
 
182
        size = len(data)
182
        self.logger.debug("Uploading %d bytes to 0x%X\n" % (len(data), addr))
183
        self.logger.debug("Uploading %d bytes to 0x%X\n" % (size, addr))
183
        offset = 0
184
        offset = 0
184
        while size > 0:
185
        while size > 0:
185
            writesize = min(size, 0xf00)
186
            writesize = min(size, 0xf00)
186
            self._writemem(addr, data[offset:offset+writesize])
187
            self._writemem(addr, data[offset:offset+writesize])
187
            offset += writesize
188
            offset += writesize