Skip to content

Commit cdd423b

Browse files
committed
Make string0 use configurable
1 parent bc44db8 commit cdd423b

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

ports/espressif/mpconfigport.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ CIRCUITPY_PORT_SERIAL = 1
5959

6060
CIRCUITPY_LIB_TLSF = 0
6161

62+
CIRCUITPY_LIBC_STRING0 = 0
63+
6264
# These modules are implemented in ports/<port>/common-hal:
6365
CIRCUITPY__EVE ?= 1
6466
CIRCUITPY_ALARM ?= 1

py/circuitpy_defns.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,10 @@ SRC_CIRCUITPY_COMMON = \
10031003
shared/runtime/stdout_helpers.c \
10041004
shared/runtime/sys_stdio_mphal.c
10051005

1006+
ifeq ($(CIRCUITPY_LIBC_STRING0),1)
1007+
SRC_CIRCUITPY_COMMON += shared/libc/string0.c
1008+
endif
1009+
10061010
ifeq ($(CIRCUITPY_QRIO),1)
10071011
SRC_CIRCUITPY_COMMON += lib/quirc/lib/decode.c lib/quirc/lib/identify.c lib/quirc/lib/quirc.c lib/quirc/lib/version_db.c
10081012
$(BUILD)/lib/quirc/lib/%.o: CFLAGS += -Wno-type-limits -Wno-shadow -Wno-sign-compare -include shared-module/qrio/quirc_alloc.h

py/circuitpy_mpconfig.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ CIRCUITPY_MESSAGE_COMPRESSION_LEVEL ?= 9
6666
# implementation of TLSF, which can be used instead by setting CIRCUITPY_LIB_TLSF=0.
6767
CIRCUITPY_LIB_TLSF ?= 1
6868

69+
# By default, use our copy of string0 (memcpy and friends) because it is optimized. Some vendor SDKs
70+
# or ROMs may provide their own implementation of string0, which can be used instead by setting
71+
# CIRCUITPY_LIBC_STRING0=0.
72+
CIRCUITPY_LIBC_STRING0 ?= 1
73+
6974
# Reduce the size of in-flash properties. Requires support in the .ld linker
7075
# file, so not enabled by default.
7176
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 0

0 commit comments

Comments
 (0)