summaryrefslogtreecommitdiff
path: root/tmk_core/common.mk
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-02-14 01:44:22 +0000
committerGitHub <noreply@github.com>2021-02-14 01:44:22 +0000
commit1f2fe2eab99548f4bde2a79b03e3303cc9b73214 (patch)
tree22c7b61acf16ce3e25b5c35ce56cc2bb6ebec290 /tmk_core/common.mk
parent72e515547aedbfd0b91296a51a81861236be8fe5 (diff)
downloadqmk_firmware-1f2fe2eab99548f4bde2a79b03e3303cc9b73214.tar.gz
qmk_firmware-1f2fe2eab99548f4bde2a79b03e3303cc9b73214.zip
Refactor platform logic within print.h (#11863)
* Remove GCC check from debug * Remove platform logic from common.mk * Refactor platform logic within print.h * restore debug.c format * headers * Rename function pointer type * review comments * Update tmk_core/common/printf.c Co-authored-by: Nick Brassel <nick@tzarc.org> * Format Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'tmk_core/common.mk')
-rw-r--r--tmk_core/common.mk19
1 files changed, 5 insertions, 14 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 3cf3edde35..238b3c69fd 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -1,5 +1,3 @@
-PRINTF_PATH = $(LIB_PATH)/printf
-
COMMON_DIR = common
PLATFORM_COMMON_DIR = $(COMMON_DIR)/$(PLATFORM_KEY)
@@ -10,7 +8,6 @@ TMK_COMMON_SRC += $(COMMON_DIR)/host.c \
$(COMMON_DIR)/action_macro.c \
$(COMMON_DIR)/action_layer.c \
$(COMMON_DIR)/action_util.c \
- $(COMMON_DIR)/print.c \
$(COMMON_DIR)/debug.c \
$(COMMON_DIR)/sendchar_null.c \
$(COMMON_DIR)/eeconfig.c \
@@ -20,17 +17,11 @@ TMK_COMMON_SRC += $(COMMON_DIR)/host.c \
$(COMMON_DIR)/sync_timer.c \
$(PLATFORM_COMMON_DIR)/bootloader.c \
-ifeq ($(PLATFORM),AVR)
- TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
-else ifeq ($(PLATFORM),CHIBIOS)
- TMK_COMMON_SRC += $(PRINTF_PATH)/printf.c
- TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_FLOAT
- TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_EXPONENTIAL
- TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_LONG_LONG
- TMK_COMMON_DEFS += -DPRINTF_DISABLE_SUPPORT_PTRDIFF_T
- VPATH += $(PRINTF_PATH)
-else ifeq ($(PLATFORM),ARM_ATSAM)
- TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
+# Use platform provided print - fall back to lib/printf
+ifneq ("$(wildcard $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk)","")
+ include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk
+else
+ include $(TMK_PATH)/$(COMMON_DIR)/lib_printf.mk
endif
# Option modules