@ -48,7 +48,7 @@ INC += -I$(HAL_DIR)/inc
INC += -I$( USBDEV_DIR) /core/inc -I$( USBDEV_DIR) /class/inc
#INC += -I$(USBHOST_DIR)
CFLAGS_CORTEX_M = -mthumb -mfpu= fpv4-sp-d16 -mfloat-abi= hard -fsingle-precision-constant -Wdouble-promotion
CFLAGS_CORTEX_M = -mthumb -mfpu= fpv4-sp-d16 -mfloat-abi= hard
CFLAGS_MCU_f4 = $( CFLAGS_CORTEX_M) -mtune= cortex-m4 -mcpu= cortex-m4 -DMCU_SERIES_F4
CFLAGS_MCU_f7 = $( CFLAGS_CORTEX_M) -mtune= cortex-m7 -mcpu= cortex-m7 -DMCU_SERIES_F7
CFLAGS_MCU_l4 = $( CFLAGS_CORTEX_M) -mtune= cortex-m4 -mcpu= cortex-m4 -DMCU_SERIES_L4
@ -60,6 +60,13 @@ CFLAGS += $(COPT)
CFLAGS += -Iboards/$( BOARD)
CFLAGS += -DSTM32_HAL_H= '<stm32$(MCU_SERIES)xx_hal.h>'
i f e q ( $( FLOAT_IMPL ) , d o u b l e )
CFLAGS += -DMICROPY_FLOAT_IMPL= MICROPY_FLOAT_IMPL_DOUBLE
e l s e
CFLAGS += -DMICROPY_FLOAT_IMPL= MICROPY_FLOAT_IMPL_FLOAT
CFLAGS += -fsingle-precision-constant -Wdouble-promotion
e n d i f
LDFLAGS = -nostdlib -L $( LD_DIR) -T $( LD_FILE) -Map= $( @:.elf= .map) --cref
LIBS = $( shell $( CC) $( CFLAGS) -print-libgcc-file-name)
@ -77,32 +84,6 @@ endif
SRC_LIB = $( addprefix lib/,\
libc/string0.c \
libm/math.c \
libm/thumb_vfp_sqrtf.c \
libm/asinfacosf.c \
libm/atanf.c \
libm/atan2f.c \
libm/fmodf.c \
libm/nearbyintf.c \
libm/log1pf.c \
libm/acoshf.c \
libm/asinhf.c \
libm/atanhf.c \
libm/kf_rem_pio2.c \
libm/kf_sin.c \
libm/kf_cos.c \
libm/kf_tan.c \
libm/ef_rem_pio2.c \
libm/erf_lgamma.c \
libm/sf_sin.c \
libm/sf_cos.c \
libm/sf_tan.c \
libm/sf_frexp.c \
libm/sf_modf.c \
libm/sf_ldexp.c \
libm/sf_erf.c \
libm/wf_lgamma.c \
libm/wf_tgamma.c \
oofatfs/ff.c \
oofatfs/option/unicode.c \
mp-readline/readline.c \
@ -113,6 +94,81 @@ SRC_LIB = $(addprefix lib/,\
utils/sys_stdio_mphal.c \
)
i f e q ( $( FLOAT_IMPL ) , d o u b l e )
SRC_LIBM = $( addprefix lib/libm_dbl/,\
__cos.c \
__expo2.c \
__fpclassify.c \
__rem_pio2.c \
__rem_pio2_large.c \
__signbit.c \
__sin.c \
__tan.c \
acos.c \
acosh.c \
asin.c \
asinh.c \
atan.c \
atan2.c \
atanh.c \
ceil.c \
cos.c \
cosh.c \
erf.c \
exp.c \
expm1.c \
floor.c \
fmod.c \
frexp.c \
ldexp.c \
lgamma.c \
log.c \
log10.c \
log1p.c \
modf.c \
nearbyint.c \
pow.c \
rint.c \
scalbn.c \
sin.c \
sinh.c \
sqrt.c \
tan.c \
tanh.c \
tgamma.c \
trunc.c \
)
e l s e
SRC_LIBM = $( addprefix lib/libm/,\
math.c \
thumb_vfp_sqrtf.c \
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 \
nearbyintf.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 \
)
e n d i f
EXTMOD_SRC_C = $( addprefix extmod/,\
modonewire.c \
)
@ -258,6 +314,7 @@ endif
OBJ =
OBJ += $( PY_O)
OBJ += $( addprefix $( BUILD) /, $( SRC_LIB:.c= .o) )
OBJ += $( addprefix $( BUILD) /, $( SRC_LIBM:.c= .o) )
OBJ += $( addprefix $( BUILD) /, $( EXTMOD_SRC_C:.c= .o) )
OBJ += $( addprefix $( BUILD) /, $( DRIVERS_SRC_C:.c= .o) )
OBJ += $( addprefix $( BUILD) /, $( SRC_C:.c= .o) )