flash: use the handle

This commit is contained in:
Robert Jördens 2016-05-16 22:02:11 +02:00
parent 3ae44e762f
commit 18878ba050
1 changed files with 1 additions and 2 deletions

View File

@ -98,7 +98,6 @@ def main():
bin = os.path.join(opts.dir, "top.bin") bin = os.path.join(opts.dir, "top.bin")
if not os.access(bin, os.R_OK): if not os.access(bin, os.R_OK):
bin_handle, bin = tempfile.mkstemp() bin_handle, bin = tempfile.mkstemp()
bin_handle.close()
bit = os.path.join(opts.dir, "top.bit") bit = os.path.join(opts.dir, "top.bit")
conv = True conv = True
prog.append("jtagspi_program {} 0x{:x}".format( prog.append("jtagspi_program {} 0x{:x}".format(
@ -122,7 +121,7 @@ def main():
prog.append("exit") prog.append("exit")
try: try:
if conv: if conv:
bit2bin(bit, bin) bit2bin(bit, bin_handle)
subprocess.check_call([ subprocess.check_call([
"openocd", "openocd",
"-f", os.path.join("board", opts.target + ".cfg"), "-f", os.path.join("board", opts.target + ".cfg"),