From 8c02b94946c437ed841fe294442b1f0d2401c678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20V=C3=B6r=C3=B6s?= Date: Sat, 5 Jun 2021 19:53:46 +0200 Subject: [PATCH] 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. --- ports/nrf/Makefile | 19 ++++++++++++++++++- ports/nrf/mpconfigport.h | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8680950804..a3f914dbc1 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 714b1cc24f..183fdf6818 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 #define MICROPY_PIN_DEFS_PORT_H "pin_defs_nrf5.h" + +#ifndef MP_NEED_LOG2 +#define MP_NEED_LOG2 (1) +#endif