From eabe8b971a0f1091ba6026c31ae55177c084b9e5 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 19 Jul 2022 23:35:51 +0200 Subject: [PATCH] list extensions instead of macros names ("bin,uf2" not BIN_UF2) the modules_support_matrix usees a dictionnary per board instead of a list optionally include the frozen modules URLs in it --- conf.py | 4 +-- docs/shared_bindings_matrix.py | 32 +++++++++++++------ .../boards/arduino_mkr1300/mpconfigboard.mk | 2 +- .../boards/arduino_mkrzero/mpconfigboard.mk | 2 +- .../arduino_nano_33_iot/mpconfigboard.mk | 2 +- .../boards/arduino_zero/mpconfigboard.mk | 2 +- .../feather_m0_adalogger/mpconfigboard.mk | 2 +- .../boards/feather_m0_basic/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm69/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm9x/mpconfigboard.mk | 2 +- .../atmel-samd/boards/uchip/mpconfigboard.mk | 2 +- ports/atmel-samd/mpconfigport.mk | 2 +- .../boards/raspberrypi_zero/mpconfigboard.mk | 2 +- .../raspberrypi_zero_w/mpconfigboard.mk | 2 +- ports/broadcom/mpconfigport.mk | 2 +- ports/cxd56/mpconfigport.mk | 2 +- ports/espressif/mpconfigport.mk | 6 ++-- ports/litex/mpconfigport.mk | 2 +- ports/mimxrt10xx/mpconfigport.mk | 2 +- .../electronut_labs_blip/mpconfigboard.mk | 2 +- .../makerdiary_nrf52840_mdk/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- ports/nrf/boards/microbit_v2/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10056/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10059/mpconfigboard.mk | 2 +- ports/nrf/mpconfigport.mk | 2 +- ports/raspberrypi/mpconfigport.mk | 2 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 2 +- ports/stm/mpconfigport.mk | 2 +- shared-bindings/support_matrix.rst | 4 +-- tools/build_board_info.py | 29 ++++------------- tools/build_release_files.py | 6 ++-- 32 files changed, 67 insertions(+), 66 deletions(-) diff --git a/conf.py b/conf.py index c92e8bb719..b7e2f29914 100644 --- a/conf.py +++ b/conf.py @@ -52,8 +52,8 @@ subprocess.check_output(["make", "stubs"]) #modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards() modules_support_matrix = shared_bindings_matrix.support_matrix_by_board() modules_support_matrix_reverse = defaultdict(list) -for board, modules in modules_support_matrix.items(): - for module in modules[0]: +for board, matrix_info in modules_support_matrix.items(): + for module in matrix_info["modules"]: modules_support_matrix_reverse[module].append(board) modules_support_matrix_reverse = dict( diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 8b4f5f876a..41202a4fae 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -204,7 +204,7 @@ def get_repository_url(directory): repository_urls[directory] = path return path -def frozen_modules_from_dirs(frozen_mpy_dirs): +def frozen_modules_from_dirs(frozen_mpy_dirs, withurl): """ Go through the list of frozen directories and extract the python modules. Paths are of the type: @@ -221,10 +221,16 @@ def frozen_modules_from_dirs(frozen_mpy_dirs): if sub.name in frozen_excludes: continue if sub.name.endswith(".py"): - frozen_modules.append((sub.name[:-3], url_repository)) + if withurl: + frozen_modules.append((sub.name[:-3], url_repository)) + else: + frozen_modules.append(sub.name[:-3]) continue if next(sub.glob("**/*.py"), None): # tests if not empty - frozen_modules.append((sub.name, url_repository)) + if withurl: + frozen_modules.append((sub.name, url_repository)) + else: + frozen_modules.append(sub.name) return frozen_modules def lookup_setting(settings, key, default=''): @@ -244,7 +250,7 @@ def all_ports_all_boards(ports=SUPPORTED_PORTS): continue yield (port, entry) -def support_matrix_by_board(use_branded_name=True): +def support_matrix_by_board(use_branded_name=True, withurl=True): """ Compiles a list of the available core modules available for each board. """ @@ -275,17 +281,21 @@ def support_matrix_by_board(use_branded_name=True): if "CIRCUITPY_BUILD_EXTENSIONS" in settings: board_extensions = settings["CIRCUITPY_BUILD_EXTENSIONS"] else: - raise "Board extensions undefined." + raise OSError(f"Board extensions undefined: {board_name}.") frozen_modules = [] if "FROZEN_MPY_DIRS" in settings: - frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"]) + frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"], withurl) if frozen_modules: frozen_modules.sort() # generate alias boards too board_matrix = [( - board_name, (board_modules, frozen_modules, board_extensions) + board_name, { + "modules": board_modules, + "frozen_libraries": frozen_modules, + "extensions": board_extensions, + } )] if entry.name in aliases_by_board: for alias in aliases_by_board[entry.name]: @@ -295,7 +305,11 @@ def support_matrix_by_board(use_branded_name=True): else: alias = alias.replace("_"," ").title() board_matrix.append(( - alias, (board_modules, frozen_modules, board_extensions), + alias, { + "modules": board_modules, + "frozen_libraries": frozen_modules, + "extensions": board_extensions, + }, )) return board_matrix # this is now a list of (board,modules) @@ -303,7 +317,7 @@ def support_matrix_by_board(use_branded_name=True): executor = ThreadPoolExecutor(max_workers=os.cpu_count()) mapped_exec = executor.map(support_matrix, all_ports_all_boards()) # flatmap with comprehensions - boards = dict(sorted([board for matrix in mapped_exec for board in matrix])) + boards = dict(sorted([board for matrix in mapped_exec for board in matrix], key=lambda x: x[0])) return boards diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index 4dd49a489a..261e30d7e5 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index a771332b99..4f058e4f2a 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 40b39dc4f9..f289aad065 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index 92560d8d2c..a347b70a63 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 087cb507c3..b0e01e43a5 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index b4d32497aa..f54da83f11 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 782fa55a5e..a1891f972e 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index b991fb35d8..3bc3fa3ed0 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 0182b92d1a..543007ce11 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -6,7 +6,7 @@ USB_MANUFACTURER = "Itaca Innovation" CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 9d8472c8ea..94b19c5303 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -134,4 +134,4 @@ CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO) endif # same51 ###################################################################### -CIRCUITPY_BUILD_EXTENSIONS ?= BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS ?= bin,uf2 diff --git a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk index 861fd6720f..b6adb5d6bb 100644 --- a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" -CIRCUITPY_BUILD_EXTENSIONS = KERNEL_IMG +CIRCUITPY_BUILD_EXTENSIONS = disk.img.zip,kernel.img diff --git a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk index fa2267391d..cd55f73ee8 100644 --- a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" -CIRCUITPY_BUILD_EXTENSIONS = KERNEL_IMG +CIRCUITPY_BUILD_EXTENSIONS = disk.img.zip,kernel.img diff --git a/ports/broadcom/mpconfigport.mk b/ports/broadcom/mpconfigport.mk index 1f99f43922..d0c6acf408 100644 --- a/ports/broadcom/mpconfigport.mk +++ b/ports/broadcom/mpconfigport.mk @@ -25,4 +25,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 USB_NUM_ENDPOINT_PAIRS = 8 USB_HIGHSPEED = 1 -CIRCUITPY_BUILD_EXTENSIONS ?= KERNEL8_IMG +CIRCUITPY_BUILD_EXTENSIONS ?= disk.img.zip,kernel8.img diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 972f4a98f0..2f0cd90c7f 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -26,4 +26,4 @@ CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 -CIRCUITPY_BUILD_EXTENSIONS ?= SPK +CIRCUITPY_BUILD_EXTENSIONS ?= spk diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 03603bbbf7..2655093be5 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -40,7 +40,7 @@ CIRCUITPY_PARALLELDISPLAY = 0 # Protomatter needs to support ESP32. CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_USB = 0 -CIRCUITPY_BUILD_EXTENSIONS ?= BIN +CIRCUITPY_BUILD_EXTENSIONS ?= bin else ifeq ($(IDF_TARGET),esp32c3) CIRCUITPY_AESIO = 0 @@ -58,7 +58,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 CIRCUITPY_USB = 0 -CIRCUITPY_BUILD_EXTENSIONS ?= BIN +CIRCUITPY_BUILD_EXTENSIONS ?= bin else ifeq ($(IDF_TARGET),esp32s3) CIRCUITPY_BLEIO = 1 @@ -72,7 +72,7 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_BLEIO_HCI = 0 endif -CIRCUITPY_BUILD_EXTENSIONS ?= BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS ?= bin,uf2 # From ESP32-S2/S3 Technical Reference Manual: # diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 6c43dfc1b8..2e342db47d 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -30,4 +30,4 @@ CIRCUITPY_SDCARDIO = 0 CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 -CIRCUITPY_BUILD_EXTENSIONS ?= DFU +CIRCUITPY_BUILD_EXTENSIONS ?= dfu diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 244603b30a..5ffec18cfb 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -22,4 +22,4 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ -CIRCUITPY_BUILD_EXTENSIONS ?= HEX_UF2 +CIRCUITPY_BUILD_EXTENSIONS ?= hex,uf2 diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk index 4e9e0e2d4d..0e3b1b9048 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk @@ -5,7 +5,7 @@ USB_MANUFACTURER = "Electronut Labs" MCU_CHIP = nrf52840 -CIRCUITPY_BUILD_EXTENSIONS = HEX +CIRCUITPY_BUILD_EXTENSIONS = hex INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk index c90d1218ba..887bf0a7da 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk @@ -5,7 +5,7 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 -CIRCUITPY_BUILD_EXTENSIONS = HEX +CIRCUITPY_BUILD_EXTENSIONS = hex QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk index c6b578c087..1a650d5d4d 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -5,6 +5,6 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 -CIRCUITPY_BUILD_EXTENSIONS = HEX_UF2 +CIRCUITPY_BUILD_EXTENSIONS = hex,uf2 INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.mk b/ports/nrf/boards/microbit_v2/mpconfigboard.mk index a5d0becd68..d0430ea403 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -3,7 +3,7 @@ CIRCUITPY_CREATION_ID = 0x80D8 MCU_CHIP = nrf52833 -CIRCUITPY_BUILD_EXTENSIONS = COMBINED_HEX +CIRCUITPY_BUILD_EXTENSIONS = combined.hex INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 0e6d4397d1..b30e6ee7a2 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -5,7 +5,7 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index 2c023a9d92..fe702a50c9 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -5,6 +5,6 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 -CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index c8cd4b9f68..c1d3dce6e5 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -4,7 +4,7 @@ LD_TEMPLATE_FILE = boards/common.template.ld INTERNAL_LIBM = 1 -CIRCUITPY_BUILD_EXTENSIONS ?= UF2 +CIRCUITPY_BUILD_EXTENSIONS ?= uf2 # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 8 diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index 230fe1ad1a..6d4ff8bbe8 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -1,6 +1,6 @@ # All raspberrypi ports have longints. LONGINT_IMPL = MPZ -CIRCUITPY_BUILD_EXTENSIONS ?= UF2 +CIRCUITPY_BUILD_EXTENSIONS ?= uf2 CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 8342ce6444..3bbfb7eec8 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -13,7 +13,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 -CIRCUITPY_BUILD_EXTENSIONS = UF2 +CIRCUITPY_BUILD_EXTENSIONS = uf2 OPTIMIZATION_FLAGS = -Os diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 107c4e7247..1628925a89 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,7 +1,7 @@ LONGINT_IMPL ?= MPZ INTERNAL_LIBM ?= 1 -CIRCUITPY_BUILD_EXTENSIONS ?= BIN +CIRCUITPY_BUILD_EXTENSIONS ?= bin ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F405xx STM32F407xx)) CIRCUITPY_ALARM = 1 diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index e007e27b47..c54bfa94e1 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -21,9 +21,9 @@ capable board, as well as each :term:`frozen module` included on it. {% for key, value in support_matrix|dictsort %} {{ '.. _' ~ key|replace(" ", "-") ~ ':' }} * - {{ key }} - - {{ ':py:mod:`' ~ value[0]|join("`, :py:mod:`") ~ '`' }} + - {{ ':py:mod:`' ~ value.modules|join("`, :py:mod:`") ~ '`' }} - {% for module in value[1] %}\ + {% for module in value.frozen_libraries %}\ {% if loop.index == 1 %}**Frozen Modules:** {% endif %}\ {% if loop.index > 1 %}, {% endif %}\ {% if module[1] %}{{ '`' ~ module[0] ~ ' <' ~ module[1] ~ '>`__' }}\ diff --git a/tools/build_board_info.py b/tools/build_board_info.py index dff0a9e523..de6f15f207 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -23,20 +23,6 @@ from shared_bindings_matrix import ( support_matrix_by_board, ) -extensions_by_macro = { - "BIN": ("bin",), - "UF2": ("uf2",), - "BIN_UF2": ("bin", "uf2"), - "HEX": ("hex",), - "HEX_UF2": ("hex", "uf2"), - "SPK": ("spk",), - "DFU": ("dfu",), - "BIN_DFU": ("bin", "dfu"), - "COMBINED_HEX": ("combined.hex",), - "KERNEL8_IMG": ("disk.img.zip", "kernel8.img"), - "KERNEL_IMG": ("disk.img.zip", "kernel.img"), -} - language_allow_list = set( [ "ID", @@ -228,7 +214,7 @@ def generate_download_info(): languages = get_languages() - support_matrix = support_matrix_by_board(use_branded_name=False) + support_matrix = support_matrix_by_board(use_branded_name=False, withurl=False) new_stable = "-" not in new_tag @@ -257,19 +243,17 @@ def generate_download_info(): board_info = board_mapping[board_id] for alias in [board_id] + board_info["aliases"]: alias_info = board_mapping[alias] - modules_list = support_matrix[alias][0] - frozen_libraries = [frozen[0] for frozen in support_matrix[alias][1]] - extensions = support_matrix[alias][2] if alias not in current_info: changes["new_boards"].append(alias) current_info[alias] = {"downloads": 0, "versions": []} new_version = { "stable": new_stable, "version": new_tag, - "modules": support_matrix[alias][0], "languages": languages, - "extensions": extensions, - "frozen_libraries": frozen_libraries, + # add modules, extensions, frozen_libraries explicitly + "modules": support_matrix[alias]["modules"], + "extensions": support_matrix[alias]["extensions"], + "frozen_libraries": support_matrix[alias]["frozen_libraries"], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) @@ -279,9 +263,10 @@ def generate_download_info(): if changes["new_release"] and user: create_pr(changes, current_info, git_info, user) else: - print("No new release to update") if "DEBUG" in os.environ: print(create_json(current_info).decode("utf8")) + else: + print("No new release to update") if __name__ == "__main__": diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 473038ec10..309d91c368 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -86,8 +86,10 @@ for board in build_boards: success = "\033[31mfailed\033[0m" other_output = "" - extensions_id = board_settings["CIRCUITPY_BUILD_EXTENSIONS"] - extensions = build_info.extensions_by_macro[extensions_id] + extensions = [ + extension.strip() + for extension in board_settings["CIRCUITPY_BUILD_EXTENSIONS"].split(",") + ] for extension in extensions: temp_filename = "../ports/{port}/{build}/firmware.{extension}".format(