From 11d225fe6238d7af0e189232766c16b089d63c59 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Fri, 24 Jul 2020 20:44:55 -0700 Subject: [PATCH 01/11] Use 2 cores per job in github build As of today, https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners states that hosted runners have a 2-core CPU. This uses make -j $physical_cores to try and be better about utilizing the time spent on those machines. When github upgrades runners to have more cores we'll benefit from that too. --- tools/build_release_files.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 3563dd99f1..1209c18ada 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: MIT import os +import multiprocessing import sys import subprocess import shutil @@ -27,6 +28,8 @@ sha, version = build_info.get_version_info() languages = build_info.get_languages() exit_status = 0 +cores = multiprocessing.cpu_count() +print('building boards with parallelism {}'.format(cores)) for board in build_boards: bin_directory = "../bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) @@ -41,8 +44,8 @@ for board in build_boards: # But sometimes a particular language needs to be built from scratch, if, for instance, # CFLAGS_INLINE_LIMIT is set for a particular language to make it fit. clean_build_check_result = subprocess.run( - "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( - port = board_info["port"], language=language, board=board), + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build -j {cores} | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( + port = board_info["port"], language=language, board=board, cores=cores), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) clean_build = clean_build_check_result.returncode == 0 From ebc1373c08509c3c5eb1420b8a91fe5329d6718a Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 25 Jul 2020 10:23:42 -0700 Subject: [PATCH 02/11] use -j2 in the actual build also --- tools/build_release_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 1209c18ada..98e81499ed 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -54,8 +54,8 @@ for board in build_boards: build_dir += "-{language}".format(language=language) make_result = subprocess.run( - "make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build}".format( - port = board_info["port"], language=language, board=board, build=build_dir), + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build} -j {cores}".format( + port = board_info["port"], language=language, board=board, build=build_dir, cores=cores), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) build_duration = time.monotonic() - start_time From b1b253c012e75e35a6a307a994e736fd9d7cc9bc Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 26 Jul 2020 13:39:42 +0200 Subject: [PATCH 03/11] fluff_m0: add pin aliases Add aliases for SDI, SDO and EN, so that pin names match the text on the PCB to avoid confusion. Also disable all pins from port B, because that package of SAMD21 doesn't have port B. --- .../boards/fluff_m0/mpconfigboard.h | 24 +++++++++++++++++++ ports/atmel-samd/boards/fluff_m0/pins.c | 3 +++ 2 files changed, 27 insertions(+) diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h index 0782c980df..810abc0a2f 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h @@ -18,3 +18,27 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// There is no port B +#define IGNORE_PIN_PB00 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index ac7811328b..6b56297afe 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -13,7 +13,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_SDO), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, @@ -31,6 +33,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_EN), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From b2c4b0bcfa40b0247e9e4f48dc05a175fc5b044e Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 26 Jul 2020 17:26:32 +0200 Subject: [PATCH 04/11] fluff_m0: don't exclude portb pins explicitly --- .../boards/fluff_m0/mpconfigboard.h | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h index 810abc0a2f..0782c980df 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h @@ -18,27 +18,3 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - -// There is no port B -#define IGNORE_PIN_PB00 1 -#define IGNORE_PIN_PB01 1 -#define IGNORE_PIN_PB02 1 -#define IGNORE_PIN_PB03 1 -#define IGNORE_PIN_PB04 1 -#define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB06 1 -#define IGNORE_PIN_PB07 1 -#define IGNORE_PIN_PB08 1 -#define IGNORE_PIN_PB09 1 -#define IGNORE_PIN_PB10 1 -#define IGNORE_PIN_PB11 1 -#define IGNORE_PIN_PB12 1 -#define IGNORE_PIN_PB13 1 -#define IGNORE_PIN_PB14 1 -#define IGNORE_PIN_PB15 1 -#define IGNORE_PIN_PB16 1 -#define IGNORE_PIN_PB17 1 -#define IGNORE_PIN_PB22 1 -#define IGNORE_PIN_PB23 1 -#define IGNORE_PIN_PB30 1 -#define IGNORE_PIN_PB31 1 From 01cd1c5b347544e5f987fc836bf23864b55a3c29 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Jul 2020 18:42:24 -0700 Subject: [PATCH 05/11] add isort to doc deps Fixes #3200 --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 51029bcba8..f2d0682eec 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,3 +3,4 @@ recommonmark==0.6.0 sphinxcontrib-svg2pdfconverter==0.1.0 astroid sphinx-autoapi +isort From 2bdd62220e1a6b5072d59cbab53730f852670df9 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Mon, 27 Jul 2020 21:50:36 -0400 Subject: [PATCH 06/11] adjust stack for SAMD21 to accomodate larger pystack -- update frozen module adafruit_busdevice --- frozen/Adafruit_CircuitPython_BusDevice | 2 +- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.h | 2 +- ports/atmel-samd/mpconfigport.h | 2 +- py/circuitpy_mpconfig.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index e9411c4244..eb4b21e216 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit e9411c4244984b69ec6928370ede40cec014c10b +Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 0c5e5b7622..12c48b1e39 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -28,7 +28,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) //divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) //divisible by 8 #define USER_NEOPIXELS_PIN (&pin_PB23) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 540a2f77c7..2a2428d679 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -109,7 +109,7 @@ #endif #ifndef CIRCUITPY_DEFAULT_STACK_SIZE -#define CIRCUITPY_DEFAULT_STACK_SIZE 4096 +#define CIRCUITPY_DEFAULT_STACK_SIZE 3584 #endif #ifndef SAMD21_BOD33_LEVEL diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index a1a7ec2389..255ab99b93 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -799,7 +799,7 @@ void supervisor_run_background_tasks_if_tick(void); #endif #ifndef CIRCUITPY_PYSTACK_SIZE -#define CIRCUITPY_PYSTACK_SIZE 1024 +#define CIRCUITPY_PYSTACK_SIZE 1536 #endif #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" From 945736e9bb1cbab62d4ab5c4d426c125aa530288 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Mon, 27 Jul 2020 22:13:04 -0400 Subject: [PATCH 07/11] add adjustments for crickit and displayio variants of CPX --- .../boards/circuitplayground_express_crickit/mpconfigboard.h | 2 +- .../boards/circuitplayground_express_displayio/mpconfigboard.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 312fd26268..95b4ec110e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -30,7 +30,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 4796e90a51..d478ea38b4 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -28,7 +28,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting. -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 #define USER_NEOPIXELS_PIN (&pin_PB23) From e15bcebb6efe54f82fa7ac0da4f18b7a482e2f57 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Tue, 28 Jul 2020 17:31:17 +0800 Subject: [PATCH 08/11] Added display QSTR to Wio Terminal --- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 254d730a89..0558191e63 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -1,4 +1,5 @@ #include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { @@ -86,5 +87,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 92216d64171a668772488f1ae1b88ddb2779d950 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Jul 2020 11:14:25 -0700 Subject: [PATCH 09/11] Use samd peripherals fixed for gcc 10 --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index e4161d7d6d..0f5f1522d0 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 +Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 From 5b675cc83f6d7892563a360d23dfed6c89f0f003 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 28 Jul 2020 14:19:43 -0400 Subject: [PATCH 10/11] fix windows' encoding defaults --- tools/gen_usb_descriptor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index adec33100e..36650d18da 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -62,8 +62,8 @@ parser.add_argument('--midi_ep_num_out', type=int, default=0, help='endpoint number of MIDI OUT') parser.add_argument('--midi_ep_num_in', type=int, default=0, help='endpoint number of MIDI IN') -parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True) -parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True) +parser.add_argument('--output_c_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) +parser.add_argument('--output_h_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) args = parser.parse_args() From efee11dffe3843ea3e8ce8650543caba5074e1cd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Jul 2020 11:42:58 -0700 Subject: [PATCH 11/11] Add black too --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index f2d0682eec..d98e2b30c3 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ sphinxcontrib-svg2pdfconverter==0.1.0 astroid sphinx-autoapi isort +black