mirror of https://github.com/m-labs/artiq.git
artiq_flash: fix bit2bin
This commit is contained in:
parent
5e4ae4dfd9
commit
c9fbb7024c
|
@ -275,10 +275,7 @@ def main():
|
||||||
def convert_gateware(bit_filename):
|
def convert_gateware(bit_filename):
|
||||||
bin_handle, bin_filename = tempfile.mkstemp(
|
bin_handle, bin_filename = tempfile.mkstemp(
|
||||||
prefix="artiq_", suffix="_" + os.path.basename(bit_filename))
|
prefix="artiq_", suffix="_" + os.path.basename(bit_filename))
|
||||||
with open(bit_filename, "rb") as bit_file, \
|
with open(bit_filename, "rb") as bit_file, open(bin_handle, "wb") as bin_file:
|
||||||
open(bin_handle, "wb") as bin_file:
|
|
||||||
if header:
|
|
||||||
bin_file.write(b"\x00"*8)
|
|
||||||
bit2bin(bit_file, bin_file)
|
bit2bin(bit_file, bin_file)
|
||||||
atexit.register(lambda: os.unlink(bin_filename))
|
atexit.register(lambda: os.unlink(bin_filename))
|
||||||
return bin_filename
|
return bin_filename
|
||||||
|
|
Loading…
Reference in New Issue