From b8e913c8db73ebf890e4604ee41991a34354a600 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 18 Aug 2021 00:18:58 +0100 Subject: [PATCH] Migrate platform independent code from tmk_core -> quantum (#13673) * Migrate action|keyboard|keycode|eeconfig from tmk_core -> quantum --- common_features.mk | 7 +++++++ {tmk_core/common => quantum}/action.c | 0 {tmk_core/common => quantum}/action.h | 0 {tmk_core/common => quantum}/action_code.h | 0 {tmk_core/common => quantum}/action_layer.c | 0 {tmk_core/common => quantum}/action_layer.h | 0 {tmk_core/common => quantum}/action_macro.c | 0 {tmk_core/common => quantum}/action_macro.h | 0 {tmk_core/common => quantum}/action_tapping.c | 0 {tmk_core/common => quantum}/action_tapping.h | 0 {tmk_core/common => quantum}/action_util.c | 0 {tmk_core/common => quantum}/action_util.h | 0 {tmk_core/common => quantum}/eeconfig.c | 0 {tmk_core/common => quantum}/eeconfig.h | 0 {tmk_core/common => quantum}/keyboard.c | 4 ++++ {tmk_core/common => quantum}/keyboard.h | 0 {tmk_core/common => quantum}/keycode.h | 0 quantum/via.h | 2 +- tmk_core/common.mk | 10 ++-------- 19 files changed, 14 insertions(+), 9 deletions(-) rename {tmk_core/common => quantum}/action.c (100%) rename {tmk_core/common => quantum}/action.h (100%) rename {tmk_core/common => quantum}/action_code.h (100%) rename {tmk_core/common => quantum}/action_layer.c (100%) rename {tmk_core/common => quantum}/action_layer.h (100%) rename {tmk_core/common => quantum}/action_macro.c (100%) rename {tmk_core/common => quantum}/action_macro.h (100%) rename {tmk_core/common => quantum}/action_tapping.c (100%) rename {tmk_core/common => quantum}/action_tapping.h (100%) rename {tmk_core/common => quantum}/action_util.c (100%) rename {tmk_core/common => quantum}/action_util.h (100%) rename {tmk_core/common => quantum}/eeconfig.c (100%) rename {tmk_core/common => quantum}/eeconfig.h (100%) rename {tmk_core/common => quantum}/keyboard.c (99%) rename {tmk_core/common => quantum}/keyboard.h (100%) rename {tmk_core/common => quantum}/keycode.h (100%) diff --git a/common_features.mk b/common_features.mk index 1eece0242e..d09d4f1eff 100644 --- a/common_features.mk +++ b/common_features.mk @@ -20,6 +20,13 @@ QUANTUM_SRC += \ $(QUANTUM_DIR)/send_string.c \ $(QUANTUM_DIR)/bitwise.c \ $(QUANTUM_DIR)/led.c \ + $(QUANTUM_DIR)/action.c \ + $(QUANTUM_DIR)/action_layer.c \ + $(QUANTUM_DIR)/action_macro.c \ + $(QUANTUM_DIR)/action_tapping.c \ + $(QUANTUM_DIR)/action_util.c \ + $(QUANTUM_DIR)/eeconfig.c \ + $(QUANTUM_DIR)/keyboard.c \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c \ $(QUANTUM_DIR)/logging/debug.c \ diff --git a/tmk_core/common/action.c b/quantum/action.c similarity index 100% rename from tmk_core/common/action.c rename to quantum/action.c diff --git a/tmk_core/common/action.h b/quantum/action.h similarity index 100% rename from tmk_core/common/action.h rename to quantum/action.h diff --git a/tmk_core/common/action_code.h b/quantum/action_code.h similarity index 100% rename from tmk_core/common/action_code.h rename to quantum/action_code.h diff --git a/tmk_core/common/action_layer.c b/quantum/action_layer.c similarity index 100% rename from tmk_core/common/action_layer.c rename to quantum/action_layer.c diff --git a/tmk_core/common/action_layer.h b/quantum/action_layer.h similarity index 100% rename from tmk_core/common/action_layer.h rename to quantum/action_layer.h diff --git a/tmk_core/common/action_macro.c b/quantum/action_macro.c similarity index 100% rename from tmk_core/common/action_macro.c rename to quantum/action_macro.c diff --git a/tmk_core/common/action_macro.h b/quantum/action_macro.h similarity index 100% rename from tmk_core/common/action_macro.h rename to quantum/action_macro.h diff --git a/tmk_core/common/action_tapping.c b/quantum/action_tapping.c similarity index 100% rename from tmk_core/common/action_tapping.c rename to quantum/action_tapping.c diff --git a/tmk_core/common/action_tapping.h b/quantum/action_tapping.h similarity index 100% rename from tmk_core/common/action_tapping.h rename to quantum/action_tapping.h diff --git a/tmk_core/common/action_util.c b/quantum/action_util.c similarity index 100% rename from tmk_core/common/action_util.c rename to quantum/action_util.c diff --git a/tmk_core/common/action_util.h b/quantum/action_util.h similarity index 100% rename from tmk_core/common/action_util.h rename to quantum/action_util.h diff --git a/tmk_core/common/eeconfig.c b/quantum/eeconfig.c similarity index 100% rename from tmk_core/common/eeconfig.c rename to quantum/eeconfig.c diff --git a/tmk_core/common/eeconfig.h b/quantum/eeconfig.h similarity index 100% rename from tmk_core/common/eeconfig.h rename to quantum/eeconfig.h diff --git a/tmk_core/common/keyboard.c b/quantum/keyboard.c similarity index 99% rename from tmk_core/common/keyboard.c rename to quantum/keyboard.c index fcc51973fd..0eb41e7d30 100644 --- a/tmk_core/common/keyboard.c +++ b/quantum/keyboard.c @@ -256,6 +256,8 @@ void keyboard_setup(void) { keyboard_pre_init_kb(); } +#ifndef SPLIT_KEYBOARD + /** \brief is_keyboard_master * * FIXME: needs doc @@ -268,6 +270,8 @@ __attribute__((weak)) bool is_keyboard_master(void) { return true; } */ __attribute__((weak)) bool is_keyboard_left(void) { return true; } +#endif + /** \brief should_process_keypress * * Override this function if you have a condition where keypresses processing should change: diff --git a/tmk_core/common/keyboard.h b/quantum/keyboard.h similarity index 100% rename from tmk_core/common/keyboard.h rename to quantum/keyboard.h diff --git a/tmk_core/common/keycode.h b/quantum/keycode.h similarity index 100% rename from tmk_core/common/keycode.h rename to quantum/keycode.h diff --git a/quantum/via.h b/quantum/via.h index d0510fcabd..de0a21da20 100644 --- a/quantum/via.h +++ b/quantum/via.h @@ -16,7 +16,7 @@ #pragma once -#include "tmk_core/common/eeconfig.h" // for EECONFIG_SIZE +#include "eeconfig.h" // for EECONFIG_SIZE // Keyboard level code can change where VIA stores the magic. // The magic is the build date YYMMDD encoded as BCD in 3 bytes, diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 57de8d95e8..69d27e6c0b 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -1,14 +1,8 @@ COMMON_DIR = common PLATFORM_COMMON_DIR = $(COMMON_DIR)/$(PLATFORM_KEY) -TMK_COMMON_SRC += $(COMMON_DIR)/host.c \ - $(COMMON_DIR)/keyboard.c \ - $(COMMON_DIR)/action.c \ - $(COMMON_DIR)/action_tapping.c \ - $(COMMON_DIR)/action_macro.c \ - $(COMMON_DIR)/action_layer.c \ - $(COMMON_DIR)/action_util.c \ - $(COMMON_DIR)/eeconfig.c \ +TMK_COMMON_SRC += \ + $(COMMON_DIR)/host.c \ $(COMMON_DIR)/report.c \ $(COMMON_DIR)/sync_timer.c \ $(COMMON_DIR)/usb_util.c \