Skip to content

Commit 9db321d

Browse files
committed
atmel-samd: Enable longints for M4 builds.
Fixes #110
1 parent 268bf6f commit 9db321d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ports/atmel-samd/mpconfigport.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
5959
#define MICROPY_PY_STRUCT (0)
6060
#define MICROPY_PY_SYS (1)
61-
// If you change MICROPY_LONGINT_IMPL, also change MPY_TOOL_LONGINT_IMPL in mpconfigport.mk.
62-
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
6361
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
6462
#define MICROPY_STREAMS_NON_BLOCK (1)
6563

@@ -140,12 +138,17 @@ typedef long mp_off_t;
140138
#define CIRCUITPY_MCU_FAMILY samd21
141139
#define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21"
142140
#define PORT_HEAP_SIZE (16384 + 4096)
141+
// If you change MICROPY_LONGINT_IMPL, also change MPY_TOOL_LONGINT_IMPL in mpconfigport.mk.
142+
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
143143
#endif
144144

145145
#ifdef SAMD51
146146
#define CIRCUITPY_MCU_FAMILY samd51
147147
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51"
148148
#define PORT_HEAP_SIZE (0x20000) // 128KiB
149+
// If you change MICROPY_LONGINT_IMPL, also change MPY_TOOL_LONGINT_IMPL in mpconfigport.mk.
150+
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
151+
#define MP_SSIZE_MAX (0x7fffffff)
149152
#endif
150153

151154
// extra built in modules to add to the list of known ones

ports/atmel-samd/mpconfigport.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk
22
# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers.
33
# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h.
4+
ifeq ($(CHIP_FAMILY), samd21)
45
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=none
6+
endif
57

6-
INTERNAL_LIBM = 1
8+
ifeq ($(CHIP_FAMILY), samd51)
9+
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
10+
endif
711

12+
INTERNAL_LIBM = 1

0 commit comments

Comments
 (0)