Add lightweight printf support

For now, printf() isn't hooked up to anything, but snprintf() can be
used to create a string to pass off to usart.tx_blocking().
This commit is contained in:
2020-04-13 19:47:33 -07:00
parent 0efa8d4fd8
commit 5b0dbb9743
3 changed files with 9 additions and 1 deletions

View File

@@ -69,7 +69,7 @@ endif
# Ignores dotfiles and other garbage some tools leave behind
define find_important
$(shell find $(1) -type f -and -name $(2) -and -not -iname "*~" -and -not -iname "*#*" -and -not \( -path "*.cquery_cached_index*" \) -and -not \( -path "*build*" \) )
$(shell find $(1) -type f -and -name $(2) -and -not -iname "*~" -and -not -iname "*#*" -and -not \( -path "*.cquery_cached_index*" \) -and -not \( -path "*build*" \) -and -not \( -path "*ThirdParty/printf/test/*" \) )
endef
FONTS := small large_digits
@@ -118,10 +118,14 @@ CFLAGS += -ffreestanding
CFLAGS += -fstack-usage -Wstack-usage=128
# Defines
CFLAGS += -D$(DEVICE_FAMILY_DEFINE) -D$(DEVICE_TYPE_DEFINE) -D$(DEVICE_LINE_DEFINE)
CFLAGS += -DPRINTF_DISABLE_SUPPORT_FLOAT -DPRINTF_DISABLE_SUPPORT_EXPONENTIAL -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T
# Consider this one if we are running short on flash, it saved about 1K
#CFLAGS += -DPRINTF_DISABLE_SUPPORT_LONG_LONG
# Includes
CFLAGS += -I./Bsp/Mcu/
CFLAGS += -I./ThirdParty/stm32/$(DEVICE_LINE)/Include
CFLAGS += -I./ThirdParty/CMSIS/Core/Include
CFLAGS += -I./ThirdParty/printf
CFLAGS += -I./build/gen/
CFLAGS += -I.