Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa310ae

Browse files
authored
Merge pull request #36 from oktopus97/master
added byte_count parameter to the tofile() function
2 parents d349cf0 + 5df2f85 commit fa310ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

intelhex/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,15 @@ def write_hex_file(self, f, write_start_addr=True, eolstyle='native', byte_count
709709
if fclose:
710710
fclose()
711711

712-
def tofile(self, fobj, format):
712+
def tofile(self, fobj, format, byte_count=16):
713713
"""Write data to hex or bin file. Preferred method over tobin or tohex.
714714
715715
@param fobj file name or file-like object
716716
@param format file format ("hex" or "bin")
717+
@param byte_count bytes per line
717718
"""
718719
if format == 'hex':
719-
self.write_hex_file(fobj)
720+
self.write_hex_file(fobj, byte_count=byte_count)
720721
elif format == 'bin':
721722
self.tobinfile(fobj)
722723
else:

0 commit comments

Comments
 (0)