diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 961b38370d..8b4f5f876a 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -272,6 +272,11 @@ def support_matrix_by_board(use_branded_name=True): board_modules.append(base[module]['name']) board_modules.sort() + if "CIRCUITPY_BUILD_EXTENSIONS" in settings: + board_extensions = settings["CIRCUITPY_BUILD_EXTENSIONS"] + else: + raise "Board extensions undefined." + frozen_modules = [] if "FROZEN_MPY_DIRS" in settings: frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"]) @@ -279,7 +284,9 @@ def support_matrix_by_board(use_branded_name=True): frozen_modules.sort() # generate alias boards too - board_matrix = [(board_name, (board_modules, frozen_modules))] + board_matrix = [( + board_name, (board_modules, frozen_modules, board_extensions) + )] if entry.name in aliases_by_board: for alias in aliases_by_board[entry.name]: if use_branded_name: @@ -287,7 +294,9 @@ def support_matrix_by_board(use_branded_name=True): alias = aliases_brand_names[alias] else: alias = alias.replace("_"," ").title() - board_matrix.append( (alias, (board_modules, frozen_modules)) ) + board_matrix.append(( + alias, (board_modules, frozen_modules, board_extensions), + )) return board_matrix # this is now a list of (board,modules) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index c3d75202bf..4dd49a489a 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index eea3a27f13..a771332b99 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 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 895c027ee5..40b39dc4f9 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index f1c3631dcb..92560d8d2c 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 62336ecf50..087cb507c3 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index cfd1f63cb3..b4d32497aa 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 48c0f47064..782fa55a5e 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 4003dd67f0..b991fb35d8 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 90b5600dcb..0182b92d1a 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Itaca Innovation" CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 3ea6c44049..9d8472c8ea 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -133,3 +133,5 @@ CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO) endif # same51 ###################################################################### + +CIRCUITPY_BUILD_EXTENSIONS ?= BIN_UF2 diff --git a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk index 74f8511c2d..861fd6720f 100644 --- a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Zero" USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" + +CIRCUITPY_BUILD_EXTENSIONS = KERNEL_IMG diff --git a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk index 24d09e0530..fa2267391d 100644 --- a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Zero W" USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" + +CIRCUITPY_BUILD_EXTENSIONS = KERNEL_IMG diff --git a/ports/broadcom/mpconfigport.mk b/ports/broadcom/mpconfigport.mk index 7296461d1f..1f99f43922 100644 --- a/ports/broadcom/mpconfigport.mk +++ b/ports/broadcom/mpconfigport.mk @@ -24,3 +24,5 @@ INTERNAL_FLASH_FILESYSTEM = 1 USB_NUM_ENDPOINT_PAIRS = 8 USB_HIGHSPEED = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= KERNEL8_IMG diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 813d85d4a7..972f4a98f0 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -25,3 +25,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= SPK diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 457dd21a3d..03603bbbf7 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -40,6 +40,7 @@ CIRCUITPY_PARALLELDISPLAY = 0 # Protomatter needs to support ESP32. CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_USB = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= BIN else ifeq ($(IDF_TARGET),esp32c3) CIRCUITPY_AESIO = 0 @@ -57,6 +58,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 CIRCUITPY_USB = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= BIN else ifeq ($(IDF_TARGET),esp32s3) CIRCUITPY_BLEIO = 1 @@ -70,6 +72,8 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_BLEIO_HCI = 0 endif +CIRCUITPY_BUILD_EXTENSIONS ?= BIN_UF2 + # From ESP32-S2/S3 Technical Reference Manual: # # Endpoint number 0 always present (bi-directional, consisting of EP0 IN and EP0 OUT) diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 57f5113b69..6c43dfc1b8 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -29,3 +29,5 @@ CIRCUITPY_SDCARDIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= DFU diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index e7e7abe141..244603b30a 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -21,3 +21,5 @@ CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ + +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 2b46f4397a..4e9e0e2d4d 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk @@ -5,6 +5,8 @@ USB_MANUFACTURER = "Electronut Labs" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = HEX + INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_DISPLAYIO = 1 diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk index 7da9ed1896..c90d1218ba 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk @@ -5,5 +5,7 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 +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 c4fa121744..c6b578c087 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -5,4 +5,6 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 +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 78e76d3b53..a5d0becd68 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -3,6 +3,8 @@ CIRCUITPY_CREATION_ID = 0x80D8 MCU_CHIP = nrf52833 +CIRCUITPY_BUILD_EXTENSIONS = COMBINED_HEX + INTERNAL_FLASH_FILESYSTEM = 1 # USB pins aren't used. diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 48f68a30ae..0e6d4397d1 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -5,5 +5,7 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 +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 9dc3cc71ed..2c023a9d92 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -5,4 +5,6 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = BIN_UF2 + INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 6aff88b289..c8cd4b9f68 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -4,6 +4,8 @@ LD_TEMPLATE_FILE = boards/common.template.ld INTERNAL_LIBM = 1 +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 32666ed9ea..230fe1ad1a 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -1,5 +1,7 @@ # All raspberrypi ports have longints. LONGINT_IMPL = MPZ +CIRCUITPY_BUILD_EXTENSIONS ?= UF2 +CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 CIRCUITPY_ALARM ?= 1 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 77b046ada7..8342ce6444 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -13,6 +13,8 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 +CIRCUITPY_BUILD_EXTENSIONS = UF2 + OPTIMIZATION_FLAGS = -Os LD_COMMON = boards/common_default.ld diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index dd83e0d7bc..107c4e7247 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,6 +1,8 @@ LONGINT_IMPL ?= MPZ INTERNAL_LIBM ?= 1 +CIRCUITPY_BUILD_EXTENSIONS ?= BIN + ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F405xx STM32F407xx)) CIRCUITPY_ALARM = 1 CIRCUITPY_CANIO = 1 diff --git a/tools/build_board_info.py b/tools/build_board_info.py index f78ffa3eac..dff0a9e523 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -23,69 +23,18 @@ from shared_bindings_matrix import ( support_matrix_by_board, ) -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") - -# Default extensions -extension_by_port = { - "atmel-samd": UF2, - "broadcom": KERNEL8_IMG, - "cxd56": SPK, - "espressif": BIN_UF2, - "litex": DFU, - "mimxrt10xx": HEX_UF2, - "nrf": UF2, - "raspberrypi": UF2, - "stm": BIN, -} - -# Per board overrides -extension_by_board = { - # samd - "arduino_mkr1300": BIN_UF2, - "arduino_mkrzero": BIN_UF2, - "arduino_nano_33_iot": BIN_UF2, - "arduino_zero": BIN_UF2, - "feather_m0_adalogger": BIN_UF2, - "feather_m0_basic": BIN_UF2, - "feather_m0_rfm69": BIN_UF2, - "feather_m0_rfm9x": BIN_UF2, - "uchip": BIN_UF2, - # nRF52840 dev kits that may not have UF2 bootloaders, - "makerdiary_nrf52840_mdk": HEX, - "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, - "pca10056": BIN_UF2, - "pca10059": BIN_UF2, - "electronut_labs_blip": HEX, - "microbit_v2": COMBINED_HEX, - # stm32 - "meowbit_v121": UF2, - "sparkfun_stm32_thing_plus": BIN_UF2, - "swan_r5": BIN_UF2, - # esp32 - "adafruit_feather_esp32_v2": BIN, - # esp32c3 - "adafruit_qtpy_esp32c3": BIN, - "ai_thinker_esp32-c3s": BIN, - "ai_thinker_esp32-c3s-2m": BIN, - "beetle-esp32-c3": BIN, - "espressif_esp32c3_devkitm_1_n4": BIN, - "lilygo_ttgo_t-01c3": BIN, - "lolin_c3_mini": BIN, - "microdev_micro_c3": BIN, - "lilygo_ttgo_t-oi-plus": BIN, - # broadcom - "raspberrypi_zero": KERNEL_IMG, - "raspberrypi_zero_w": KERNEL_IMG, +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( @@ -129,19 +78,15 @@ def get_board_mapping(): if board_path.is_dir(): board_files = os.listdir(board_path.path) board_id = board_path.name - extensions = extension_by_port[port] - extensions = extension_by_board.get(board_path.name, extensions) aliases = aliases_by_board.get(board_path.name, []) boards[board_id] = { "port": port, - "extensions": extensions, "download_count": 0, "aliases": aliases, } for alias in aliases: boards[alias] = { "port": port, - "extensions": extensions, "download_count": 0, "alias": True, "aliases": [], @@ -310,20 +255,21 @@ def generate_download_info(): board_files = os.listdir(board_path.path) board_id = board_path.name 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": board_info["extensions"], - "frozen_libraries": [frozen[0] for frozen in support_matrix[alias][1]], + "extensions": extensions, + "frozen_libraries": frozen_libraries, } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 3fe714e393..473038ec10 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -12,6 +12,9 @@ import shutil import build_board_info as build_info import time +sys.path.append("../docs") +from shared_bindings_matrix import get_settings_from_makefile + for port in build_info.SUPPORTED_PORTS: result = subprocess.run("rm -rf ../ports/{port}/build*".format(port=port), shell=True) @@ -39,6 +42,7 @@ for board in build_boards: bin_directory = "../bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) board_info = all_boards[board] + board_settings = get_settings_from_makefile("../ports/" + board_info["port"], board) for language in languages: bin_directory = "../bin/{board}/{language}".format(board=board, language=language) @@ -82,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] - for extension in board_info["extensions"]: + for extension in extensions: temp_filename = "../ports/{port}/{build}/firmware.{extension}".format( port=board_info["port"], build=build_dir, extension=extension )