From 7fc32070431ac08677eaa30c2ab8aa52f48db221 Mon Sep 17 00:00:00 2001 From: Gilles DOFFE Date: Sun, 12 May 2019 10:19:40 +0200 Subject: [PATCH] sys: add pseudomodule scanf_float To read float number from stdin, add "-u scanf_float" option to the linker. This option is setup using a pseudomodule as it is already done for printf_float. Just add to your Makefile: USEMODULE += scanf_float Signed-off-by: Gilles DOFFE --- makefiles/pseudomodules.inc.mk | 1 + sys/Makefile.include | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 3f0b799ed4..748647fe37 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -65,6 +65,7 @@ PSEUDOMODULES += saul_adc PSEUDOMODULES += saul_default PSEUDOMODULES += saul_gpio PSEUDOMODULES += saul_nrf_temperature +PSEUDOMODULES += scanf_float PSEUDOMODULES += schedstatistics PSEUDOMODULES += sock PSEUDOMODULES += sock_ip diff --git a/sys/Makefile.include b/sys/Makefile.include index 1779637afa..a9ab8095ef 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -77,6 +77,12 @@ ifneq (,$(filter printf_float,$(USEMODULE))) endif endif +ifneq (,$(filter scanf_float,$(USEMODULE))) + ifeq (1,$(USE_NANO_SPECS)) + export LINKFLAGS += -u _scanf_float + endif +endif + ifneq (,$(filter riotboot,$(FEATURES_USED))) include $(RIOTBASE)/sys/riotboot/Makefile.include endif