From caff976a86659b8bd14d7f99e1dbf173cbcc47cc Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 14 Jun 2016 22:41:57 +0200 Subject: added option for printf with float support --- defines.mk | 3 +++ usb-bmp280/Makefile | 2 +- usb-led/Makefile | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/defines.mk b/defines.mk index fd57edd..be0703e 100644 --- a/defines.mk +++ b/defines.mk @@ -268,3 +268,6 @@ endif ## Linker flags LDFLAGS = -mmcu=$(MCU) LDFLAGS += -Wl,--gc-sections +ifdef PRINTF_HAS_FLOAT +LDFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm +endif diff --git a/usb-bmp280/Makefile b/usb-bmp280/Makefile index 5bfc049..d0c6322 100644 --- a/usb-bmp280/Makefile +++ b/usb-bmp280/Makefile @@ -27,6 +27,7 @@ OBJ := $(NAME).o LIBS := util led lufa-descriptor-usbserial usbio bmp280 EXTERNAL_LIBS := lufa SPREADAVR_PATH := .. +PRINTF_HAS_FLOAT := 1 LUFA_PATH := $(SPREADAVR_PATH)/contrib/lufa-LUFA-151115 LUFA_OPTS = -D USB_DEVICE_ONLY @@ -45,7 +46,6 @@ LUFA_COMPONENTS := USB USBCLASS include $(SPREADAVR_PATH)/include.mk -LDFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm AVRDUDE_PORT := $(shell $(SPREADAVR_PATH)/tools/detect_newest_acm) #AVRDUDE_PORT := $(shell $(SPREADAVR_PATH)/tools/detect_lufa_cdc 1) RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_sparkfun diff --git a/usb-led/Makefile b/usb-led/Makefile index e0afd1e..d7d03ef 100644 --- a/usb-led/Makefile +++ b/usb-led/Makefile @@ -28,6 +28,7 @@ EXTERNAL_LIBS := lufa SPREADAVR_PATH := .. RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_lufa_cdc RESET_PARAM := 'r' +PRINTF_HAS_FLOAT := 1 LUFA_PATH := $(SPREADAVR_PATH)/contrib/lufa-LUFA-151115 LUFA_OPTS = -D USB_DEVICE_ONLY -- cgit v1.2.3