summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltán Vörös <zvoros@gmail.com>2021-06-05 19:53:46 +0200
committerDamien George <damien@micropython.org>2021-06-08 16:39:47 +1000
commit8c02b94946c437ed841fe294442b1f0d2401c678 (patch)
treeaa89ceb4ea2fbaaa15c15f3859e5097138f75d0b
parentde2e081260395f47d21bf39a97f3461df3d8b94f (diff)
nrf: Add more math sources to Makefile, and enable log2 implementation.
This commit adds a few math functions to the source list in the Makefile, and implements the log2f function, so that ulab can be compiled on the nrf boards. It also addresses part of #5162.
-rw-r--r--ports/nrf/Makefile19
-rw-r--r--ports/nrf/mpconfigport.h4
2 files changed, 22 insertions, 1 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 868095080..a3f914dbc 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -160,8 +160,16 @@ SRC_LIB += $(addprefix lib/,\
libm/sf_modf.c \
libm/sf_ldexp.c \
libm/asinfacosf.c \
+ libm/acoshf.c \
+ libm/asinhf.c \
libm/atanf.c \
libm/atan2f.c \
+ libm/atanhf.c \
+ libm/log1pf.c \
+ libm/sf_erf.c \
+ libm/erf_lgamma.c \
+ libm/wf_lgamma.c \
+ libm/wf_tgamma.c \
libm/roundf.c \
)
@@ -186,8 +194,17 @@ SRC_LIB += $(addprefix lib/,\
libm/sf_modf.c \
libm/sf_ldexp.c \
libm/asinfacosf.c \
+ libm/acoshf.c \
+ libm/asinhf.c \
libm/atanf.c \
libm/atan2f.c \
+ libm/atanhf.c \
+ libm/log1pf.c \
+ libm/sf_erf.c \
+ libm/erf_lgamma.c \
+ libm/wf_lgamma.c \
+ libm/wf_tgamma.c \
+ libm/roundf.c \
)
SRC_NRFX += $(addprefix lib/nrfx/drivers/src/,\
@@ -481,7 +498,7 @@ $(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
$(Q)$(SIZE) $@
# List of sources for qstr extraction
-SRC_QSTR += $(SRC_C) $(SRC_LIB) $(DRIVERS_SRC_C) $(SRC_BOARD_MODULES) $(SRC_MOD)
+SRC_QSTR += $(SRC_C) $(SRC_LIB) $(DRIVERS_SRC_C) $(SRC_BOARD_MODULES) $(SRC_MOD)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 714b1cc24..183fdf681 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -330,3 +330,7 @@ extern const struct _mp_obj_module_t ble_module;
#include <alloca.h>
#define MICROPY_PIN_DEFS_PORT_H "pin_defs_nrf5.h"
+
+#ifndef MP_NEED_LOG2
+#define MP_NEED_LOG2 (1)
+#endif