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 1/8] 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)) From 996e648a64a635800e651fae50c6191eee9b6725 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:00:26 +0200 Subject: [PATCH 2/8] changed from python2 to python3 --- firmware/tools/fir_lpf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/tools/fir_lpf.py b/firmware/tools/fir_lpf.py index 8a78c7ba..c9ae395b 100644 --- a/firmware/tools/fir_lpf.py +++ b/firmware/tools/fir_lpf.py @@ -6,7 +6,7 @@ ft = 300.0 / 24000.0 taps = [] window = [] -print("Normalized ft = " + str(ft)) +print(("Normalized ft = " + str(ft))) for n in range(0, 64): taps.append(math.sin(2 * math.pi * ft * (n - (m / 2.0))) / (math.pi * (n - (m / 2.0)))) From f31ee1172d385539609b4ac99d6d5dde7fbfa6aa Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:00:55 +0200 Subject: [PATCH 3/8] changed from python2 to python3 --- firmware/tools/make_baseband_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/tools/make_baseband_file.py b/firmware/tools/make_baseband_file.py index f0c96f1d..82edbbac 100755 --- a/firmware/tools/make_baseband_file.py +++ b/firmware/tools/make_baseband_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (C) 2016 Furrtek # From 6fc03a26512166a6732572586ca11296a3864f99 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:02:01 +0200 Subject: [PATCH 4/8] changed from python2 to python3 --- firmware/tools/make_bitmap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/tools/make_bitmap.py b/firmware/tools/make_bitmap.py index 103a58c0..16920f38 100755 --- a/firmware/tools/make_bitmap.py +++ b/firmware/tools/make_bitmap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (C) 2016 Furrtek # @@ -42,7 +42,7 @@ def convert_png(file): rgb_im = im.convert('RGBA') if rgb_im.size[0] % 8 or rgb_im.size[1] % 8: - print(file + ": Size isn\'t a multiple of 8") + print((file + ": Size isn\'t a multiple of 8")) sys.exit(-1) name = path.basename(file).split(".")[0].lower(); @@ -112,4 +112,4 @@ f.write("\n") f.write("} /* namespace ui */\n\n") f.write("#endif/*__BITMAP_HPP__*/\n") -print("Converted " + str(count) + " files") +print(("Converted " + str(count) + " files")) From 560c7143bf9293c7c6004d3b77d184785737436c Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:03:07 +0200 Subject: [PATCH 5/8] Update make_dcs.py --- firmware/tools/make_dcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/tools/make_dcs.py b/firmware/tools/make_dcs.py index 0879f07b..290269af 100755 --- a/firmware/tools/make_dcs.py +++ b/firmware/tools/make_dcs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (C) 2016 Furrtek # @@ -40,4 +40,4 @@ for c in range (0, 0x200): # DCS code is 9 bits p10 = cb[3] ^ cb[5] ^ cb[6] ^ cb[8] ^ 1; p11 = cb[0] ^ cb[1] ^ cb[2] ^ cb[3] ^ cb[6] ^ 1; - print ' 0b{0:011b}'.format((p11<<10) | (p10<<9) | (p9<<8) |(p8<<7) | (p7<<6) | (p6<<5) | (p5<<4) | (p4<<3) | (p3<<2) | (p2<<1) | (p1)) + ', // ' + str(c); + print(' 0b{0:011b}'.format((p11<<10) | (p10<<9) | (p9<<8) |(p8<<7) | (p7<<6) | (p6<<5) | (p5<<4) | (p4<<3) | (p3<<2) | (p2<<1) | (p1)) + ', // ' + str(c)); From 1a5c360efe4761d8723efd3e4b36971af6c081e0 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:04:07 +0200 Subject: [PATCH 6/8] changed from python2 to python3 --- firmware/tools/make_image_chunk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/tools/make_image_chunk.py b/firmware/tools/make_image_chunk.py index 5bcf4fb4..4ad18192 100755 --- a/firmware/tools/make_image_chunk.py +++ b/firmware/tools/make_image_chunk.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. From 95d1bca9fd531a9e1e55624e835540e045abeb61 Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:04:31 +0200 Subject: [PATCH 7/8] changed from python2 to python3 --- firmware/tools/make_spi_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/tools/make_spi_image.py b/firmware/tools/make_spi_image.py index 983e7c6e..a7151793 100755 --- a/firmware/tools/make_spi_image.py +++ b/firmware/tools/make_spi_image.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. From 587fbfbbb14f7013521b9b982c4856d19b647ffe Mon Sep 17 00:00:00 2001 From: BehleZebub <116460179+BehleZebub@users.noreply.github.com> Date: Wed, 2 Nov 2022 00:36:04 +0100 Subject: [PATCH 8/8] added shebang line for pyhton3 on unix --- firmware/tools/fir_lpf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/tools/fir_lpf.py b/firmware/tools/fir_lpf.py index c9ae395b..bbfe91e1 100644 --- a/firmware/tools/fir_lpf.py +++ b/firmware/tools/fir_lpf.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import math m = 64 - 1