Browse Source

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

And set the default for MICROPY_PY_MATH as 1 for both MCU types.
pull/9753/head
robert-hh 2 years ago
committed by Damien George
parent
commit
be31fde012
  1. 13
      ports/samd/mcu/samd21/mpconfigmcu.h
  2. 29
      ports/samd/mcu/samd21/mpconfigmcu.mk
  3. 11
      ports/samd/mcu/samd51/mpconfigmcu.h

13
ports/samd/mcu/samd21/mpconfigmcu.h

@ -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)

29
ports/samd/mcu/samd21/mpconfigmcu.mk

@ -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 \
)

11
ports/samd/mcu/samd51/mpconfigmcu.h

@ -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)

Loading…
Cancel
Save