2019-10-20 23:50:12 -04:00
|
|
|
# All linking can be done with this common templated linker script, which has
|
|
|
|
# parameters that vary based on chip and/or board.
|
|
|
|
LD_TEMPLATE_FILE = boards/common.template.ld
|
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
INTERNAL_LIBM = 1
|
|
|
|
|
|
|
|
# Number of USB endpoint pairs.
|
2021-05-13 21:49:04 -04:00
|
|
|
USB_NUM_ENDPOINT_PAIRS = 8
|
2021-02-04 19:23:40 -05:00
|
|
|
|
2021-04-08 17:32:36 -04:00
|
|
|
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
|
2022-05-03 09:31:41 -04:00
|
|
|
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1
|
2022-06-01 14:12:14 -04:00
|
|
|
CIRCUITPY_LTO = 1
|
2021-04-08 17:32:36 -04:00
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
######################################################################
|
2019-03-27 17:54:36 -04:00
|
|
|
# Put samd21-only choices here.
|
2021-02-04 19:23:40 -05:00
|
|
|
|
2019-03-27 18:19:39 -04:00
|
|
|
ifeq ($(CHIP_FAMILY),samd21)
|
2020-11-24 11:26:47 -05:00
|
|
|
|
2021-01-24 22:49:28 -05:00
|
|
|
# The ?='s allow overriding in mpconfigboard.mk.
|
2019-11-22 15:44:51 -05:00
|
|
|
|
2021-05-05 12:35:41 -04:00
|
|
|
# Some of these are on by default with CIRCUITPY_FULL_BUILD, but don't
|
|
|
|
# fit in 256kB of flash
|
|
|
|
|
2021-09-02 06:25:51 -04:00
|
|
|
CIRCUITPY_AESIO ?= 0
|
2022-01-29 17:04:07 -05:00
|
|
|
CIRCUITPY_ATEXIT ?= 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_AUDIOMIXER ?= 0
|
2022-12-09 15:12:27 -05:00
|
|
|
CIRCUITPY_AUDIOMP3 ?= 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_BINASCII ?= 0
|
2021-05-05 12:35:41 -04:00
|
|
|
CIRCUITPY_BITBANGIO ?= 0
|
|
|
|
CIRCUITPY_BITMAPTOOLS ?= 0
|
|
|
|
CIRCUITPY_BLEIO_HCI = 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_BUILTINS_POW3 ?= 0
|
2022-12-09 15:12:27 -05:00
|
|
|
CIRCUITPY_BUSDEVICE ?= 0
|
2021-03-05 19:29:27 -05:00
|
|
|
CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE ?= 1
|
2021-05-05 12:35:41 -04:00
|
|
|
CIRCUITPY_COUNTIO ?= 0
|
|
|
|
# Not enough RAM for framebuffers
|
|
|
|
CIRCUITPY_FRAMEBUFFERIO ?= 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_FREQUENCYIO ?= 0
|
2022-01-29 17:04:07 -05:00
|
|
|
CIRCUITPY_GETPASS ?= 0
|
2021-10-21 17:05:48 -04:00
|
|
|
CIRCUITPY_GIFIO ?= 0
|
2022-08-09 13:06:18 -04:00
|
|
|
CIRCUITPY_I2CTARGET ?= 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_JSON ?= 0
|
2021-06-18 12:26:48 -04:00
|
|
|
CIRCUITPY_KEYPAD ?= 0
|
2021-05-05 12:35:41 -04:00
|
|
|
CIRCUITPY_MSGPACK ?= 0
|
2022-12-09 15:12:27 -05:00
|
|
|
CIRCUITPY_OS_GETENV ?= 0
|
Add adafruit_pixelmap.PixelMap
.. a fast helper for animations. It is similar to and inspired by the
PixelMap helper in Adafruit LED Animation library, but with an extremely
fast 'paste' method for setting a series of pixels. This is a common
operation for many animations, and can give a substantial speed improvement.
It's named `adafruit_pixelmap` so that we can package a compatible version
in pure Python for systems that can't fit it in C in flash, or for
Blinka.
This is a proof of concept and can make a very fast comet animation:
```python
import time
import adafruit_pixelbuf
import adafruti_pixelmap
import board
import neopixel
from supervisor import ticks_ms
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation import color
pixel_pin = board.GP0
pixel_num = 96
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB")
evens = adafruit_pixelmap.PixelMap(pixels, tuple(range(0, pixel_num, 2)))
odd_indices = tuple((i, i+2) for i in range(1, pixel_num, 4))
print(odd_indices)
odds = adafruit_pixelbuf.PixelMap(pixels, odd_indices)
assert len(odds) == len(odd_indices)
comet_length = 16
comet1 = [color.calculate_intensity(color.GREEN, ((1+i) / comet_length) ** 2.4)
for i in range(comet_length)]
comet2 = [color.calculate_intensity(color.PURPLE, ((1+i) / comet_length) ** 2.4)
for i in range(comet_length)]
pos1 = 0
pos2 = 96//4
while True:
evens.paste(comet1, pos1, wrap=True, reverse=False, others=0)
pos1 = (pos1 + 1) % len(evens)
odds.paste(comet2, pos2, wrap=True, reverse=True, others=0)
pos2 = (pos2 - 1) % len(odds)
pixels.show()
m = ticks_ms()
if m % 2000 > 1000:
time.sleep(.02)
```
2022-11-10 12:02:31 -05:00
|
|
|
CIRCUITPY_PIXELMAP ?= 0
|
2021-05-05 12:35:41 -04:00
|
|
|
CIRCUITPY_RE ?= 0
|
|
|
|
CIRCUITPY_SDCARDIO ?= 0
|
2021-03-19 18:22:00 -04:00
|
|
|
CIRCUITPY_SYNTHIO ?= 0
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1
|
2022-05-26 15:33:04 -04:00
|
|
|
CIRCUITPY_TRACEBACK = 0
|
2020-03-17 10:33:03 -04:00
|
|
|
CIRCUITPY_ULAB = 0
|
2021-05-05 12:35:41 -04:00
|
|
|
CIRCUITPY_VECTORIO = 0
|
2022-02-20 17:03:25 -05:00
|
|
|
CIRCUITPY_ZLIB = 0
|
2021-05-05 12:35:41 -04:00
|
|
|
|
2022-09-20 14:32:38 -04:00
|
|
|
# Turn off a few more things that don't fit in 192kB
|
2022-02-09 11:40:07 -05:00
|
|
|
|
|
|
|
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
|
|
|
|
CIRCUITPY_ONEWIREIO ?= 0
|
2023-02-13 21:48:03 -05:00
|
|
|
CIRCUITPY_SAFEMODE_PY ?= 0
|
2022-09-20 14:32:38 -04:00
|
|
|
CIRCUITPY_USB_IDENTIFICATION ?= 0
|
2022-02-09 11:40:07 -05:00
|
|
|
endif
|
|
|
|
|
2021-05-05 12:35:41 -04:00
|
|
|
MICROPY_PY_ASYNC_AWAIT = 0
|
2020-03-10 00:00:21 -04:00
|
|
|
|
2022-07-19 14:07:18 -04:00
|
|
|
# We don't have room for the fonts for terminalio for certain languages,
|
2021-05-14 23:41:44 -04:00
|
|
|
# so turn off terminalio, and if it's off and displayio is on,
|
|
|
|
# force a clean build.
|
|
|
|
# Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an
|
|
|
|
# ifeq, because it's not set yet.
|
2022-07-19 14:07:18 -04:00
|
|
|
ifneq (,$(filter $(TRANSLATION),ja ko ru))
|
2020-08-17 20:17:59 -04:00
|
|
|
CIRCUITPY_TERMINALIO = 0
|
2021-05-14 23:41:44 -04:00
|
|
|
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
|
2020-08-17 20:17:59 -04:00
|
|
|
endif
|
|
|
|
|
2021-05-05 12:35:41 -04:00
|
|
|
SUPEROPT_GC = 0
|
|
|
|
SUPEROPT_VM = 0
|
|
|
|
|
2022-06-01 14:12:14 -04:00
|
|
|
CIRCUITPY_LTO_PARTITION = one
|
2022-05-27 15:59:54 -04:00
|
|
|
|
2023-02-15 16:38:24 -05:00
|
|
|
# On smaller builds this saves about 180 bytes. On other boards, it may -increase- space used, so use with care.
|
2021-05-05 12:35:41 -04:00
|
|
|
CFLAGS_BOARD = -fweb -frename-registers
|
|
|
|
|
2019-12-05 22:45:53 -05:00
|
|
|
endif # samd21
|
2021-02-04 19:23:40 -05:00
|
|
|
######################################################################
|
2019-03-27 17:54:36 -04:00
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
######################################################################
|
2019-02-17 23:48:08 -05:00
|
|
|
# Put samd51-only choices here.
|
2021-02-04 19:23:40 -05:00
|
|
|
|
2019-02-17 23:48:08 -05:00
|
|
|
ifeq ($(CHIP_FAMILY),samd51)
|
2021-02-04 19:23:40 -05:00
|
|
|
|
2019-11-22 15:44:51 -05:00
|
|
|
# No native touchio on SAMD51.
|
2019-08-18 08:44:10 -04:00
|
|
|
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
2019-11-22 15:44:51 -05:00
|
|
|
|
2022-06-01 14:12:14 -04:00
|
|
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
|
|
|
CIRCUITPY_LTO_PARTITION ?= one
|
2022-05-27 15:59:54 -04:00
|
|
|
endif
|
|
|
|
|
2021-01-24 22:49:28 -05:00
|
|
|
# The ?='s allow overriding in mpconfigboard.mk.
|
2020-03-10 14:12:01 -04:00
|
|
|
|
2021-10-03 19:16:27 -04:00
|
|
|
|
2021-11-30 09:15:30 -05:00
|
|
|
CIRCUITPY_ALARM ?= 1
|
2022-02-02 18:07:02 -05:00
|
|
|
CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD)
|
2021-01-24 22:49:28 -05:00
|
|
|
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
|
2023-04-06 09:54:49 -04:00
|
|
|
CIRCUITPY_PS2IO ?= 1
|
2021-11-05 16:19:01 -04:00
|
|
|
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
|
2023-04-06 09:54:49 -04:00
|
|
|
CIRCUITPY_SAMD ?= 1
|
2023-04-06 09:55:00 -04:00
|
|
|
CIRCUITPY_SYNTHIO_MAX_CHANNELS = 12
|
2021-10-19 11:26:09 -04:00
|
|
|
CIRCUITPY_WATCHDOG ?= 1
|
2020-03-10 14:12:01 -04:00
|
|
|
|
2023-09-18 19:43:02 -04:00
|
|
|
ifeq ($(CHIP_VARIANT),SAMD51G19A)
|
|
|
|
# No I2S on SAMD51G
|
|
|
|
CIRCUITPY_AUDIOBUSIO = 0
|
|
|
|
endif
|
|
|
|
|
2019-12-05 22:45:53 -05:00
|
|
|
endif # samd51
|
2021-02-04 19:23:40 -05:00
|
|
|
######################################################################
|
2021-04-11 21:07:51 -04:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Put same51-only choices here.
|
|
|
|
|
|
|
|
ifeq ($(CHIP_FAMILY),same51)
|
|
|
|
|
2022-02-02 22:37:47 -05:00
|
|
|
# No native touchio on SAME51.
|
2021-04-11 21:07:51 -04:00
|
|
|
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
|
|
|
|
2022-06-01 14:12:14 -04:00
|
|
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
|
|
|
CIRCUITPY_LTO_PARTITION ?= one
|
2022-05-31 17:48:41 -04:00
|
|
|
endif
|
|
|
|
|
2021-04-11 21:07:51 -04:00
|
|
|
# The ?='s allow overriding in mpconfigboard.mk.
|
|
|
|
|
2021-11-30 09:15:30 -05:00
|
|
|
CIRCUITPY_ALARM ?= 1
|
2021-04-11 21:07:51 -04:00
|
|
|
CIRCUITPY_PS2IO ?= 1
|
|
|
|
CIRCUITPY_SAMD ?= 1
|
2022-02-02 22:37:47 -05:00
|
|
|
CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD)
|
2021-04-11 21:07:51 -04:00
|
|
|
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
|
2021-11-05 16:19:01 -04:00
|
|
|
CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO)
|
2021-04-11 21:07:51 -04:00
|
|
|
|
|
|
|
endif # same51
|
|
|
|
######################################################################
|
2022-05-13 05:38:03 -04:00
|
|
|
|
2022-07-21 13:43:57 -04:00
|
|
|
CIRCUITPY_BUILD_EXTENSIONS ?= uf2
|