Merge pull request #2598 from hierophect/stm32-docfix

Add stm to docs matrix
This commit is contained in:
Dan Halbert 2020-04-24 10:07:15 -04:00 committed by GitHub
commit 5a22a5d016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 156 additions and 222 deletions

View File

@ -1,5 +1,5 @@
We love CircuitPython and would love to see it come to more microcontroller
platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to
platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to
add support. While there are some major differences between ports, this page
covers the similarities that make CircuitPython what it is and how that core
fits into a variety of microcontrollers.
@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In
CircuitPython we've dubbed this component the supervisor because it monitors
and facilitates the VMs which run user Python code. Porting involves the
supervisor because many of the tasks it does while interfacing with the
hardware. Once its going though, the REPL works and debugging can migrate to a
hardware. Once complete, the REPL works and debugging can migrate to a
Python based approach rather than C.
The third core piece is the plethora of low level APIs that CircuitPython
@ -42,6 +42,44 @@ to the port's directory (in the top level until the ``ports`` directory is
present). This includes the Makefile and any C library resources. Make sure
these resources are compatible with the MIT License of the rest of the code!
Circuitpython has a number of modules enabled by default in
``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in
``mpconfigboard.mk`` during the early stages of a port in order for it to
compile. As the port progresses in module support, this list can be pruned down
as a natural "TODO" list. An example minimal build list is shown below:
.. code-block:: makefile
# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
CIRCUITPY_USB_HID = 0 # Requires USB
CIRCUITPY_USB_MIDI = 0 # Requires USB
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
Step 2: Init
--------------
Once your build is setup, the next step should be to get your clocks going as

View File

@ -26,7 +26,7 @@ import os
import re
SUPPORTED_PORTS = ["atmel-samd", "nrf", "mimxrt10xx"]
SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"]
def parse_port_config(contents, chip_keyword=None):
@ -139,7 +139,10 @@ def get_excluded_boards(base):
re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)")
chip_keyword = "CHIP_FAMILY"
elif port in ["nrf"]:
re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)")
re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)")
elif port in ["stm"]:
re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)")
chip_keyword = "MCU_SERIES"
port_dir = "ports/{}".format(port)
@ -158,10 +161,10 @@ def get_excluded_boards(base):
contents = board.read()
board_chip = re_board_chip.search(contents)
#print(entry.name, board_chip.group(1))
if not board_chip:
board_chip = "Unknown Chip"
else:
#print(entry.name, board_chip.group(1))
board_chip = board_chip.group(1)
# add port_config results to contents
@ -172,18 +175,12 @@ def get_excluded_boards(base):
check_dependent_modules = dict()
for module in modules:
board_is_excluded = False
# check if board uses `SMALL_BUILD`. if yes, and current
# check if board turns off `FULL_BUILD`. if yes, and current
# module is marked as `FULL_BUILD`, board is excluded
small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents)
small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents)
if small_build and base[module]["full_build"] == "1":
board_is_excluded = True
# check if board uses `MINIMAL_BUILD`. if yes, and current
# module is marked as `DEFAULT_BUILD`, board is excluded
min_build = re.search("CIRCUITPY_MINIMAL_BUILD = 1", contents)
if min_build and base[module]["default_value"] == "CIRCUITPY_DEFAULT_BUILD":
board_is_excluded = True
# check if module is specifically disabled for this board
re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper())
find_module = re.search(re_pattern, contents)

View File

@ -114,7 +114,7 @@ else
# Do a default shrink for small builds.
ifndef CFLAGS_INLINE_LIMIT
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS_INLINE_LIMIT = 50
endif
endif
@ -125,7 +125,7 @@ else
CFLAGS += -flto -flto-partition=none
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
endif

View File

@ -13,7 +13,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ"
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,5 +8,5 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,4 +8,4 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

View File

@ -8,4 +8,4 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -9,7 +9,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "GD25Q16C"
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

View File

@ -8,7 +8,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_PEW = 1
CIRCUITPY_ANALOGIO = 1

View File

@ -9,7 +9,7 @@ CHIP_FAMILY = samd51
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
# TODO: Turn off analogio for now for space reasons, but restore it
# when frozen module gets smaller.
CIRCUITPY_ANALOGIO = 0

View File

@ -20,7 +20,7 @@ CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
# Make more room.
SUPEROPT_GC = 0

View File

@ -8,7 +8,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,7 +8,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_I2CSLAVE = 1
CIRCUITPY_TOUCHIO = 0

View File

@ -9,5 +9,5 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -11,5 +11,5 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
LONGINT_IMPL = MPZ
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,6 +8,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,7 +8,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -8,4 +8,4 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

View File

@ -9,7 +9,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -9,7 +9,7 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0

View File

@ -64,22 +64,12 @@ ifndef CIRCUITPY_SAMD
CIRCUITPY_SAMD = 1
endif
ifndef CIRCUITPY_ULAB
ifneq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_ULAB = 1
endif
endif
ifndef CIRCUITPY_RGBMATRIX
ifneq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_RGBMATRIX = 1
endif
CIRCUITPY_RGBMATRIX = $(CIRCUITPY_FULL_BUILD)
endif
ifndef CIRCUITPY_FRAMEBUFFERIO
ifneq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_FRAMEBUFFERIO = 1
endif
CIRCUITPY_FRAMEBUFFERIO = $(CIRCUITPY_FULL_BUILD)
endif
endif # samd51

View File

@ -1,106 +1,56 @@
# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk
# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers.
# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h.
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
# Internal math library is substantially smaller than toolchain one
LONGINT_IMPL = MPZ
INTERNAL_LIBM = 1
# Chip supplied serial number, in bytes
USB_SERIAL_NUMBER_LENGTH = 24
# Longints can be implemented as mpz, as longlong, or not
LONGINT_IMPL = MPZ
# Reduced feature set for early port
CIRCUITPY_MINIMAL_BUILD = 1
# The ifndef's allow overriding in mpconfigboard.mk.
ifndef CIRCUITPY_BOARD
CIRCUITPY_BOARD = 1
ifeq ($(MCU_SERIES),F4)
# Not yet implemented common-hal modules:
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
# Can be overridden on board level
ifndef CIRCUITPY_NVM
CIRCUITPY_NVM = 0
endif
endif
ifndef CIRCUITPY_DIGITALIO
CIRCUITPY_DIGITALIO = 1
endif
ifndef CIRCUITPY_ANALOGIO
CIRCUITPY_ANALOGIO = 1
endif
ifndef CIRCUITPY_MICROCONTROLLER
CIRCUITPY_MICROCONTROLLER = 1
endif
ifndef CIRCUITPY_BUSIO
CIRCUITPY_BUSIO = 1
endif
ifndef CIRCUITPY_PULSEIO
CIRCUITPY_PULSEIO = 1
endif
ifndef CIRCUITPY_OS
CIRCUITPY_OS = 1
endif
ifndef CIRCUITPY_STORAGE
CIRCUITPY_STORAGE = 1
endif
ifndef CIRCUITPY_RANDOM
CIRCUITPY_RANDOM = 1
endif
ifndef CRICUITPY_USB_HID
CIRCUITPY_USB_HID = 1
endif
ifndef CIRCUITPY_USB_MIDI
CIRCUITPY_USB_MIDI = 1
endif
ifndef CIRCUITPY_NEOPIXEL_WRITE
CIRCUITPY_NEOPIXEL_WRITE = 1
endif
ifndef CIRCUITPY_DISPLAYIO
CIRCUITPY_DISPLAYIO = 1
endif
CFLAGS += -DMICROPY_CPYTHON_COMPAT=1
CIRCUITPY_ULAB = 1
ifeq ($(MCU_SERIES), H7)
CIRCUITPY_BOARD = 1
CIRCUITPY_DIGITALIO = 1
ifeq ($(MCU_SERIES),H7)
# Not yet implemented common-hal modules:
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_BUSIO = 1
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
CIRCUITPY_STORAGE = 0
CIRCUITPY_RANDOM = 0
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
# shared-module modules that still need prerequisites filled
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
endif
ifeq ($(MCU_SERIES), F7)
CIRCUITPY_BOARD = 1
CIRCUITPY_DIGITALIO = 1
ifeq ($(MCU_SERIES),F7)
# Not yet implemented common-hal modules:
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_BUSIO = 1
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
CIRCUITPY_STORAGE = 0
CIRCUITPY_RANDOM = 0
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
# shared-module modules that still need prerequisites filled
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
endif

View File

@ -179,17 +179,10 @@ typedef long mp_off_t;
// board-specific definitions, which control and may override definitions below.
#include "mpconfigboard.h"
// CIRCUITPY_FULL_BUILD is defined in a *.mk file.
// Remove some lesser-used functionality to make small builds fit.
// Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD)
//TODO: replace this with a rework of the FULL_BUILD system
#if !defined(MICROPY_CPYTHON_COMPAT)
#define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD)
#endif
#if !defined(MICROPY_COMP_FSTRING_LITERAL)
#define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD)
#define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT)
#endif
#define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD)
#define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD)
#define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD)
@ -223,7 +216,7 @@ typedef long mp_off_t;
#define MP_SSIZE_MAX (0x7fffffff)
#endif
#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !CIRCUITPY_MINIMAL_BUILD
#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !DISABLE_FILESYSTEM
#error No *_FLASH_FILESYSTEM set!
#endif

View File

@ -23,54 +23,20 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# mpconfigboard.mk files can specify:
# CIRCUITPY_FULL_BUILD = 1 (which is the default)
# or
# CIRCUITPY_SMALL_BUILD = 1
# which is the same as:
# CIRCUITPY_FULL_BUILD = 0
# Boards default to all modules enabled (with exceptions)
# Manually disable by overriding in #mpconfigboard.mk
# Smaller builds can be forced for resource constrained chips (typically SAMD21s
# without external flash) by setting CIRCUITPY_FULL_BUILD=0. Avoid using this
# for merely incomplete ports, as it changes settings in other files.
ifndef CIRCUITPY_FULL_BUILD
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_FULL_BUILD = 0
else
CIRCUITPY_FULL_BUILD = 1
endif
endif
CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD)
# Setting CIRCUITPY_MINIMAL_BUILD = 1 will disable all features
# Use for for early stage or highly restricted ports
ifndef CIRCUITPY_MINIMAL_BUILD
CIRCUITPY_MINIMAL_BUILD = 0
endif
CFLAGS += -DCIRCUITPY_MINIMAL_BUILD=$(CIRCUITPY_MINIMAL_BUILD)
ifndef CIRCUITPY_DEFAULT_BUILD
ifeq ($(CIRCUITPY_MINIMAL_BUILD),1)
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_DEFAULT_BUILD = 0
else
CIRCUITPY_DEFAULT_BUILD = 1
endif
endif
CFLAGS += -DCIRCUITPY_DEFAULT_BUILD=$(CIRCUITPY_DEFAULT_BUILD)
# Some features have no unique HAL component, and thus there's never
# a reason to not include them.
ifndef CIRCUITPY_ALWAYS_BUILD
CIRCUITPY_ALWAYS_BUILD = 1
endif
CFLAGS += -DCIRCUITPY_ALWAYS_BUILD=$(CIRCUITPY_ALWAYS_BUILD)
# All builtin modules are listed below, with default values (0 for off, 1 for on)
# Some are always on, some are always off, and some depend on CIRCUITPY_FULL_BUILD.
#
# *** You can override any of the defaults by defining them in your mpconfigboard.mk.
ifndef CIRCUITPY_ANALOGIO
CIRCUITPY_ANALOGIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_ANALOGIO = 1
endif
CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO)
@ -89,7 +55,6 @@ CIRCUITPY_AUDIOIO_COMPAT = $(CIRCUITPY_AUDIOIO)
endif
CFLAGS += -DCIRCUITPY_AUDIOIO_COMPAT=$(CIRCUITPY_AUDIOIO_COMPAT)
ifndef CIRCUITPY_AUDIOPWMIO
CIRCUITPY_AUDIOPWMIO = 0
endif
@ -130,17 +95,17 @@ endif
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
ifndef CIRCUITPY_BOARD
CIRCUITPY_BOARD = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_BOARD = 1
endif
CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)
ifndef CIRCUITPY_BUSIO
CIRCUITPY_BUSIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_BUSIO = 1
endif
CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO)
ifndef CIRCUITPY_DIGITALIO
CIRCUITPY_DIGITALIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_DIGITALIO = 1
endif
CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO)
@ -175,7 +140,7 @@ endif
CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE)
ifndef CIRCUITPY_MATH
CIRCUITPY_MATH = $(CIRCUITPY_ALWAYS_BUILD)
CIRCUITPY_MATH = 1
endif
CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH)
@ -185,12 +150,12 @@ endif
CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE)
ifndef CIRCUITPY_MICROCONTROLLER
CIRCUITPY_MICROCONTROLLER = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_MICROCONTROLLER = 1
endif
CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER)
ifndef CIRCUITPY_NEOPIXEL_WRITE
CIRCUITPY_NEOPIXEL_WRITE = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_NEOPIXEL_WRITE = 1
endif
CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
@ -201,12 +166,12 @@ endif
CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK)
ifndef CIRCUITPY_NVM
CIRCUITPY_NVM = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_NVM = 1
endif
CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
ifndef CIRCUITPY_OS
CIRCUITPY_OS = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_OS = 1
endif
CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS)
@ -222,7 +187,7 @@ endif
CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX)
ifndef CIRCUITPY_PULSEIO
CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_PULSEIO = 1
endif
CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO)
@ -233,17 +198,17 @@ endif
CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO)
ifndef CIRCUITPY_RANDOM
CIRCUITPY_RANDOM = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_RANDOM = 1
endif
CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM)
ifndef CIRCUITPY_ROTARYIO
CIRCUITPY_ROTARYIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_ROTARYIO = 1
endif
CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO)
ifndef CIRCUITPY_RTC
CIRCUITPY_RTC = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_RTC = 1
endif
CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC)
@ -262,22 +227,22 @@ endif
CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE)
ifndef CIRCUITPY_STORAGE
CIRCUITPY_STORAGE = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_STORAGE = 1
endif
CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE)
ifndef CIRCUITPY_STRUCT
CIRCUITPY_STRUCT = $(CIRCUITPY_ALWAYS_BUILD)
CIRCUITPY_STRUCT = 1
endif
CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT)
ifndef CIRCUITPY_SUPERVISOR
CIRCUITPY_SUPERVISOR = $(CIRCUITPY_ALWAYS_BUILD)
CIRCUITPY_SUPERVISOR = 1
endif
CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR)
ifndef CIRCUITPY_TIME
CIRCUITPY_TIME = $(CIRCUITPY_ALWAYS_BUILD)
CIRCUITPY_TIME = 1
endif
CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)
@ -288,7 +253,7 @@ endif
CFLAGS += -DCIRCUITPY_TOUCHIO_USE_NATIVE=$(CIRCUITPY_TOUCHIO_USE_NATIVE)
ifndef CIRCUITPY_TOUCHIO
CIRCUITPY_TOUCHIO = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_TOUCHIO = 1
endif
CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO)
@ -299,12 +264,12 @@ endif
CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP)
ifndef CIRCUITPY_USB_HID
CIRCUITPY_USB_HID = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_USB_HID = 1
endif
CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID)
ifndef CIRCUITPY_USB_MIDI
CIRCUITPY_USB_MIDI = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_USB_MIDI = 1
endif
CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
@ -354,6 +319,7 @@ CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART)
ifndef CIRCUITPY_ULAB
CIRCUITPY_ULAB = $(CIRCUITPY_FULL_BUILD)
endif
CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB)
# Enabled micropython.native decorator (experimental)
ifndef CIRCUITPY_ENABLE_MPY_NATIVE