From c9fbb7024c5fcf545c501792a89307b71117ba58 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 5 Mar 2022 22:43:25 +0800 Subject: [PATCH] artiq_flash: fix bit2bin --- artiq/frontend/artiq_flash.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index a4892924f..4c8d30ca3 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -275,10 +275,7 @@ def main(): def convert_gateware(bit_filename): bin_handle, bin_filename = tempfile.mkstemp( prefix="artiq_", suffix="_" + os.path.basename(bit_filename)) - with open(bit_filename, "rb") as bit_file, \ - open(bin_handle, "wb") as bin_file: - if header: - bin_file.write(b"\x00"*8) + with open(bit_filename, "rb") as bit_file, open(bin_handle, "wb") as bin_file: bit2bin(bit_file, bin_file) atexit.register(lambda: os.unlink(bin_filename)) return bin_filename