From ca4f68d24a0482d99569536f2b894e5f38ecda71 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sat, 29 Oct 2022 23:58:26 +0200 Subject: [PATCH] changed from python2 to python3 --- firmware/tools/extract_cpld_data.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/firmware/tools/extract_cpld_data.py b/firmware/tools/extract_cpld_data.py index 530a31ac..103262fa 100755 --- a/firmware/tools/extract_cpld_data.py +++ b/firmware/tools/extract_cpld_data.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. @@ -80,7 +80,7 @@ def print_block(block): for n in range(0, len(block), 8): chunk = block[n:n+8] line = ['0x%04x,' % v for v in chunk] - print('\t%s' % ' '.join(line)) + print(('\t%s' % ' '.join(line))) def crc32(blocks): import zlib @@ -92,7 +92,7 @@ def crc32(blocks): crc_bytes.append((word >> 8) & 0xff) return zlib.crc32(bytearray(crc_bytes)) & 0xffffffff -print("""#include "portapack_cpld_data.hpp" +print(("""#include "portapack_cpld_data.hpp" #include #include @@ -100,23 +100,23 @@ print("""#include "portapack_cpld_data.hpp" namespace portapack { namespace cpld { namespace %s { -""" % revision_name) +""" % revision_name)) -print('const std::array block_0 { {' % len(block_0)) +print(('const std::array block_0 { {' % len(block_0))) print_block(block_0) print("""} }; """) -print('const std::array block_1 { {' % len(block_1)) +print(('const std::array block_1 { {' % len(block_1))) print_block(block_1) -print("""} }; +print(("""} }; } /* namespace %s */ } /* namespace cpld */ } /* namespace portapack */ -""" % revision_name) +""" % revision_name)) if calculate_crc: # Apply post-programming modification to make post-programming CRC correct: @@ -124,4 +124,4 @@ if calculate_crc: programmed_block_0[0] &= 0xfbff crc = crc32((programmed_block_0, block_1)) - print('%08x' % crc) + print(('%08x' % crc))