samd/mcu: Make some settings in mpconfigmcu.h conditional.

And set the default for MICROPY_PY_MATH as 1 for both MCU types.
This commit is contained in:
robert-hh 2022-09-08 17:55:08 +02:00 committed by Damien George
parent 2251cb774b
commit be31fde012
3 changed files with 52 additions and 1 deletions

View File

@ -9,13 +9,24 @@
#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#ifndef MICROPY_PY_BUILTINS_COMPLEX
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#endif
#ifndef MICROPY_PY_MATH
#define MICROPY_PY_MATH (1)
#endif
#ifndef MICROPY_PY_CMATH
#define MICROPY_PY_CMATH (0)
#endif
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
#ifndef MICROPY_HW_UART_TXBUF
#define MICROPY_HW_UART_TXBUF (1)
#endif
#define CPU_FREQ (48000000)
#define DFLL48M_FREQ (48000000)

View File

@ -1 +1,30 @@
SRC_S += shared/runtime/gchelper_m0.s
LIBM_SRC_C += $(addprefix lib/libm/,\
acoshf.c \
asinfacosf.c \
asinhf.c \
atan2f.c \
atanf.c \
atanhf.c \
ef_rem_pio2.c \
erf_lgamma.c \
fmodf.c \
kf_cos.c \
kf_rem_pio2.c \
kf_sin.c \
kf_tan.c \
log1pf.c \
math.c \
nearbyintf.c \
roundf.c \
sf_cos.c \
sf_erf.c \
sf_frexp.c \
sf_ldexp.c \
sf_modf.c \
sf_sin.c \
sf_tan.c \
wf_lgamma.c \
wf_tgamma.c \
)

View File

@ -8,10 +8,19 @@
#define MICROPY_EMIT_INLINE_THUMB (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#ifndef MICROPY_PY_BUILTINS_COMPLEX
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#endif
#ifndef MICROPY_PY_MATH
#define MICROPY_PY_MATH (1)
#define MP_NEED_LOG2 (1)
#endif
#ifndef MICROPY_PY_CMATH
#define MICROPY_PY_CMATH (0)
#endif
#define MICROPY_PY_MACHINE_DHT_READINTO (1)
#define MICROPY_PY_ONEWIRE (1)
@ -30,7 +39,9 @@ unsigned long trng_random_u32(void);
#define VFS_BLOCK_SIZE_BYTES (1536) //
#ifndef MICROPY_HW_UART_TXBUF
#define MICROPY_HW_UART_TXBUF (1)
#endif
#define CPU_FREQ (120000000)
#define DFLL48M_FREQ (48000000)