Skip to content

Commit

Permalink
samd/mcu: Make some settings in mpconfigmcu.h conditional.
Browse files Browse the repository at this point in the history
And set the default for MICROPY_PY_MATH as 1 for both MCU types.
  • Loading branch information
robert-hh authored and dpgeorge committed Oct 25, 2022
1 parent 2251cb7 commit be31fde
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ports/samd/mcu/samd21/mpconfigmcu.h
Expand Up @@ -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)
Expand Down
29 changes: 29 additions & 0 deletions 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 changes: 11 additions & 0 deletions ports/samd/mcu/samd51/mpconfigmcu.h
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit be31fde

Please sign in to comment.