diff --git a/build_keyboard.mk b/build_keyboard.mk index 36c628c7cebf..c12aa0fce007 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -388,7 +388,7 @@ VPATH += $(COMMON_VPATH) include common_features.mk include $(BUILDDEFS_PATH)/generic_features.mk include $(TMK_PATH)/protocol.mk -include $(TMK_PATH)/common.mk +include $(PLATFORM_PATH)/common.mk include $(BUILDDEFS_PATH)/bootloader.mk SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) @@ -404,13 +404,14 @@ ifneq ($(REQUIRE_PLATFORM_KEY),) endif endif -include $(TMK_PATH)/$(PLATFORM_KEY).mk +include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk +-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk + ifneq ($(strip $(PROTOCOL)),) include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk else include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk endif --include $(TOP_DIR)/platforms/$(PLATFORM_KEY)/flash.mk # TODO: remove this bodge? PROJECT_DEFS := $(OPT_DEFS) diff --git a/build_test.mk b/build_test.mk index 6e4494d77f5c..3553125a0422 100644 --- a/build_test.mk +++ b/build_test.mk @@ -54,11 +54,11 @@ endif include common_features.mk include $(BUILDDEFS_PATH)/generic_features.mk -include $(TMK_PATH)/common.mk +include $(PLATFORM_PATH)/common.mk include $(TMK_PATH)/protocol.mk include $(QUANTUM_PATH)/debounce/tests/rules.mk include $(QUANTUM_PATH)/sequencer/tests/rules.mk -include $(TMK_PATH)/common/test/rules.mk +include $(PLATFORM_PATH)/test/rules.mk ifneq ($(filter $(FULL_TESTS),$(TEST)),) include build_full_test.mk endif @@ -73,7 +73,7 @@ $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) $(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG) -include $(TMK_PATH)/native.mk +include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk include $(TMK_PATH)/rules.mk diff --git a/common_features.mk b/common_features.mk index 896fbb0129d0..8c593024f0d1 100644 --- a/common_features.mk +++ b/common_features.mk @@ -33,8 +33,10 @@ QUANTUM_SRC += \ VPATH += $(QUANTUM_DIR)/logging # Fall back to lib/printf if there is no platform provided print -ifeq ("$(wildcard $(TMK_PATH)/common/$(PLATFORM_KEY)/printf.mk)","") +ifeq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk)","") include $(QUANTUM_PATH)/logging/print.mk +else + include $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk endif ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes) diff --git a/docs/feature_layers.md b/docs/feature_layers.md index 78d950dc4969..e30c540a79e6 100644 --- a/docs/feature_layers.md +++ b/docs/feature_layers.md @@ -45,7 +45,7 @@ Once you have a good feel for how layers work and what you can do, you can get m Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem. -Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h). +Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h). ## Functions :id=functions diff --git a/docs/fr-fr/faq_keymap.md b/docs/fr-fr/faq_keymap.md index 374a0052270c..cc0700ab8e7e 100644 --- a/docs/fr-fr/faq_keymap.md +++ b/docs/fr-fr/faq_keymap.md @@ -6,7 +6,7 @@ Cette page couvre les questions souvent posées à propos des keymaps. Si vous n Regardez [Keycodes](keycodes.md) pour une liste des keycodes disponibles. Certains keycodes spécifiques ont des documentations plus complètes de disponible. -Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h). +Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h). ## Quels sont les keycodes par défaut ? diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index 21a3bd661e7e..ccd3f8c74d92 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -4,7 +4,7 @@ QMK has a GPIO control abstraction layer which is microcontroller agnostic. This ## Functions :id=functions -The following functions provide basic control of GPIOs and are found in `tmk_core/common//gpio.h`. +The following functions provide basic control of GPIOs and are found in `platforms//gpio.h`. |Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples | |------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------| diff --git a/docs/ja/faq_keymap.md b/docs/ja/faq_keymap.md index fb44e316b78d..59c7d206a1c6 100644 --- a/docs/ja/faq_keymap.md +++ b/docs/ja/faq_keymap.md @@ -10,7 +10,7 @@ ## どのキーコードを使えますか? あなたが利用可能なキーコードのインデックスについては、[キーコード](ja/keycodes.md)を見てください。より広範なドキュメントがある場合は、そこからリンクしてあります。 -キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h) で定義されています。 +キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h) で定義されています。 ## デフォルトのキーコードとは何か? diff --git a/docs/ja/feature_layers.md b/docs/ja/feature_layers.md index 011f0e0ef19b..ca3e05583573 100644 --- a/docs/ja/feature_layers.md +++ b/docs/ja/feature_layers.md @@ -50,7 +50,7 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし レイヤーは番号順に上に積み重なっています。キーの押下の動作を決定する時に、QMK は上から順にレイヤーを走査し、`KC_TRNS` に設定されていない最初のアクティブなレイヤーに到達すると停止します。結果として、現在のレイヤーよりも数値的に低いレイヤーをアクティブにし、現在のレイヤー(あるいはアクティブでターゲットレイヤーよりも高い別のレイヤー)に `KC_TRNS` 以外のものがある場合、それが送信されるキーであり、アクティブ化したばかりのレイヤー上のキーではありません。これが、ほとんどの人の "なぜレイヤーが切り替わらないのか" 問題の原因です。 -場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h) で見つけることができます。 +場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h) で見つけることができます。 ## 関数 :id=functions diff --git a/docs/ja/pr_checklist.md b/docs/ja/pr_checklist.md index 18dbeccebbc5..caab2b4d5045 100644 --- a/docs/ja/pr_checklist.md +++ b/docs/ja/pr_checklist.md @@ -27,7 +27,7 @@ - 「旧式の」 GPIO/I2C/SPI 関数を使用しない - 正当な理由がない限り、QMK の抽象化を使用しなければなりません (怠惰は正当な理由にはなりません) - タイミングの抽象化にも従う必要があります: - `_delay_ms()` のかわりに `wait_ms()` を。(`#include ` も消します) - - `timer_read()` と `timer_read32()` など。 -- タイミング API は [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) を参照してください + - `timer_read()` と `timer_read32()` など。 -- タイミング API は [timer.h](https://github.com/qmk/qmk_firmware/blob/master/platforms/timer.h) を参照してください - 新しい抽象化が有用だと思う場合は、次のことをお勧めします: - 機能が完成するまで自分のキーボードでプロトタイプを作成する - Discord の QMK コラボレータと話し合う diff --git a/docs/pr_checklist.md b/docs/pr_checklist.md index 94c62c653549..2a2b0f1e7672 100644 --- a/docs/pr_checklist.md +++ b/docs/pr_checklist.md @@ -24,7 +24,7 @@ If there are any inconsistencies with these recommendations, you're best off [cr - no "old-school" or other low-level GPIO/I2C/SPI functions may be used -- must use QMK abstractions unless justifiable (and laziness is not valid justification) - timing abstractions should be followed too: - `wait_ms()` instead of `_delay_ms()` (remove `#include ` too) - - `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) for the timing APIs + - `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/platforms/timer.h) for the timing APIs - if you think a new abstraction is useful, you're encouraged to: - prototype it in your own keyboard until it's feature-complete - discuss it with QMK Collaborators on Discord diff --git a/docs/zh-cn/faq_keymap.md b/docs/zh-cn/faq_keymap.md index fdfa25ad9eec..ff38f3889471 100644 --- a/docs/zh-cn/faq_keymap.md +++ b/docs/zh-cn/faq_keymap.md @@ -5,7 +5,7 @@ ## 我能用什么键码? 看[键码](keycodes.md)你可以找到你能用的键码索引。可以的话这些链接可以连接到更广泛的文档。 -键码实际上定义在[common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h). +键码实际上定义在[common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h). ## 默认的键码什么样? diff --git a/keyboards/ai03/orbit/split_util.c b/keyboards/ai03/orbit/split_util.c index a83ff5bc67ec..2352e5a11186 100644 --- a/keyboards/ai03/orbit/split_util.c +++ b/keyboards/ai03/orbit/split_util.c @@ -8,7 +8,7 @@ #include "quantum.h" #ifdef EE_HANDS -# include "tmk_core/common/eeprom.h" +# include "eeprom.h" # include "eeconfig.h" #endif diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.c b/keyboards/cannonkeys/satisfaction75/satisfaction75.c index 8b5016437c9a..bd7eaf188588 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction75.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.c @@ -9,7 +9,7 @@ #include "raw_hid.h" #include "dynamic_keymap.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "version.h" // for QMK_BUILDDATE used in EEPROM magic /* Artificial delay added to get media keys to work in the encoder*/ diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c index cefdbc5f9c06..0d2fdc359cf1 100644 --- a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c +++ b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c @@ -1,5 +1,5 @@ #include "satisfaction75.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" void pre_encoder_mode_change(){ if(encoder_mode == ENC_MODE_CLOCK_SET){ diff --git a/keyboards/mxss/mxss.c b/keyboards/mxss/mxss.c index f591d39e6782..21beee232ce7 100644 --- a/keyboards/mxss/mxss.c +++ b/keyboards/mxss/mxss.c @@ -17,7 +17,7 @@ */ #include QMK_KEYBOARD_H -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "action_layer.h" #include "rgblight.h" #include "via.h" diff --git a/keyboards/mxss/mxss_frontled.c b/keyboards/mxss/mxss_frontled.c index 3c4309f0702f..f5e4613dfb20 100644 --- a/keyboards/mxss/mxss_frontled.c +++ b/keyboards/mxss/mxss_frontled.c @@ -17,7 +17,7 @@ */ #include "mxss_frontled.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "rgblight.h" #include "via.h" #include "version.h" // for QMK_BUILDDATE used in EEPROM magic diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index d5e136e06b74..a8ad795446d4 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -27,7 +27,7 @@ #include "via.h" #ifndef VIA_ENABLE -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "version.h" // for QMK_BUILDDATE used in EEPROM magic #endif diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index 77cee34ca657..5e2fde810c05 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -24,7 +24,7 @@ #include "progmem.h" #include "quantum/color.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "via.h" // uses EEPROM address, lighting value IDs #define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR) diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c index 82b1fb2fb368..63763c6c9010 100644 --- a/keyboards/wilba_tech/wt_rgb_backlight.c +++ b/keyboards/wilba_tech/wt_rgb_backlight.c @@ -68,7 +68,7 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL]; #include "progmem.h" #include "quantum/color.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "via.h" // uses EEPROM address, lighting value IDs #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR) diff --git a/paths.mk b/paths.mk index 7be1b2ce04e1..5a39d00ecd73 100644 --- a/paths.mk +++ b/paths.mk @@ -13,6 +13,9 @@ DRIVER_PATH = $(DRIVER_DIR) PLATFORM_DIR = platforms PLATFORM_PATH = $(PLATFORM_DIR) +PROTOCOL_DIR = protocol +PROTOCOL_PATH = $(TMK_DIR)/$(PROTOCOL_DIR) + BUILDDEFS_DIR = builddefs BUILDDEFS_PATH = $(BUILDDEFS_DIR) diff --git a/tmk_core/common/arm_atsam/_timer.h b/platforms/arm_atsam/_timer.h similarity index 100% rename from tmk_core/common/arm_atsam/_timer.h rename to platforms/arm_atsam/_timer.h diff --git a/tmk_core/common/arm_atsam/_wait.h b/platforms/arm_atsam/_wait.h similarity index 100% rename from tmk_core/common/arm_atsam/_wait.h rename to platforms/arm_atsam/_wait.h diff --git a/tmk_core/common/arm_atsam/atomic_util.h b/platforms/arm_atsam/atomic_util.h similarity index 100% rename from tmk_core/common/arm_atsam/atomic_util.h rename to platforms/arm_atsam/atomic_util.h diff --git a/tmk_core/common/arm_atsam/bootloader.c b/platforms/arm_atsam/bootloader.c similarity index 100% rename from tmk_core/common/arm_atsam/bootloader.c rename to platforms/arm_atsam/bootloader.c diff --git a/tmk_core/common/arm_atsam/eeprom.c b/platforms/arm_atsam/eeprom.c similarity index 100% rename from tmk_core/common/arm_atsam/eeprom.c rename to platforms/arm_atsam/eeprom.c diff --git a/tmk_core/common/arm_atsam/gpio.h b/platforms/arm_atsam/gpio.h similarity index 100% rename from tmk_core/common/arm_atsam/gpio.h rename to platforms/arm_atsam/gpio.h diff --git a/tmk_core/common/arm_atsam/pin_defs.h b/platforms/arm_atsam/pin_defs.h similarity index 100% rename from tmk_core/common/arm_atsam/pin_defs.h rename to platforms/arm_atsam/pin_defs.h diff --git a/tmk_core/common/arm_atsam/platform.c b/platforms/arm_atsam/platform.c similarity index 100% rename from tmk_core/common/arm_atsam/platform.c rename to platforms/arm_atsam/platform.c diff --git a/tmk_core/arm_atsam.mk b/platforms/arm_atsam/platform.mk similarity index 100% rename from tmk_core/arm_atsam.mk rename to platforms/arm_atsam/platform.mk diff --git a/tmk_core/common/arm_atsam/platform_deps.h b/platforms/arm_atsam/platform_deps.h similarity index 100% rename from tmk_core/common/arm_atsam/platform_deps.h rename to platforms/arm_atsam/platform_deps.h diff --git a/tmk_core/common/arm_atsam/suspend.c b/platforms/arm_atsam/suspend.c similarity index 100% rename from tmk_core/common/arm_atsam/suspend.c rename to platforms/arm_atsam/suspend.c diff --git a/tmk_core/common/arm_atsam/timer.c b/platforms/arm_atsam/timer.c similarity index 100% rename from tmk_core/common/arm_atsam/timer.c rename to platforms/arm_atsam/timer.c diff --git a/tmk_core/common/atomic_util.h b/platforms/atomic_util.h similarity index 100% rename from tmk_core/common/atomic_util.h rename to platforms/atomic_util.h diff --git a/tmk_core/common/avr/_print.h b/platforms/avr/_print.h similarity index 100% rename from tmk_core/common/avr/_print.h rename to platforms/avr/_print.h diff --git a/tmk_core/common/avr/_timer.h b/platforms/avr/_timer.h similarity index 100% rename from tmk_core/common/avr/_timer.h rename to platforms/avr/_timer.h diff --git a/tmk_core/common/avr/_wait.h b/platforms/avr/_wait.h similarity index 100% rename from tmk_core/common/avr/_wait.h rename to platforms/avr/_wait.h diff --git a/tmk_core/common/avr/atomic_util.h b/platforms/avr/atomic_util.h similarity index 100% rename from tmk_core/common/avr/atomic_util.h rename to platforms/avr/atomic_util.h diff --git a/tmk_core/common/avr/bootloader.c b/platforms/avr/bootloader.c similarity index 100% rename from tmk_core/common/avr/bootloader.c rename to platforms/avr/bootloader.c diff --git a/tmk_core/common/avr/bootloader_size.c b/platforms/avr/bootloader_size.c similarity index 100% rename from tmk_core/common/avr/bootloader_size.c rename to platforms/avr/bootloader_size.c diff --git a/tmk_core/common/avr/gpio.h b/platforms/avr/gpio.h similarity index 100% rename from tmk_core/common/avr/gpio.h rename to platforms/avr/gpio.h diff --git a/tmk_core/common/avr/pin_defs.h b/platforms/avr/pin_defs.h similarity index 100% rename from tmk_core/common/avr/pin_defs.h rename to platforms/avr/pin_defs.h diff --git a/tmk_core/common/avr/platform.c b/platforms/avr/platform.c similarity index 100% rename from tmk_core/common/avr/platform.c rename to platforms/avr/platform.c diff --git a/tmk_core/avr.mk b/platforms/avr/platform.mk similarity index 97% rename from tmk_core/avr.mk rename to platforms/avr/platform.mk index c52262273ee1..b45108736f10 100644 --- a/tmk_core/avr.mk +++ b/platforms/avr/platform.mk @@ -163,7 +163,7 @@ ifeq ($(strip $(QMK_BOOTLOADER_TYPE)),) else make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean $(QMK_BIN) generate-dfu-header --quiet --keyboard $(KEYBOARD) --output lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Keyboard.h - $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0)) $(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0)) $(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0)) diff --git a/tmk_core/common/avr/platform_deps.h b/platforms/avr/platform_deps.h similarity index 100% rename from tmk_core/common/avr/platform_deps.h rename to platforms/avr/platform_deps.h diff --git a/tmk_core/common/avr/printf.c b/platforms/avr/printf.c similarity index 100% rename from tmk_core/common/avr/printf.c rename to platforms/avr/printf.c diff --git a/tmk_core/common/avr/printf.mk b/platforms/avr/printf.mk similarity index 100% rename from tmk_core/common/avr/printf.mk rename to platforms/avr/printf.mk diff --git a/tmk_core/common/avr/sleep_led.c b/platforms/avr/sleep_led.c similarity index 100% rename from tmk_core/common/avr/sleep_led.c rename to platforms/avr/sleep_led.c diff --git a/tmk_core/common/avr/suspend.c b/platforms/avr/suspend.c similarity index 100% rename from tmk_core/common/avr/suspend.c rename to platforms/avr/suspend.c diff --git a/tmk_core/common/avr/timer.c b/platforms/avr/timer.c similarity index 100% rename from tmk_core/common/avr/timer.c rename to platforms/avr/timer.c diff --git a/tmk_core/common/avr/timer_avr.h b/platforms/avr/timer_avr.h similarity index 100% rename from tmk_core/common/avr/timer_avr.h rename to platforms/avr/timer_avr.h diff --git a/tmk_core/common/avr/xprintf.S b/platforms/avr/xprintf.S similarity index 100% rename from tmk_core/common/avr/xprintf.S rename to platforms/avr/xprintf.S diff --git a/tmk_core/common/avr/xprintf.h b/platforms/avr/xprintf.h similarity index 100% rename from tmk_core/common/avr/xprintf.h rename to platforms/avr/xprintf.h diff --git a/tmk_core/common/bootloader.h b/platforms/bootloader.h similarity index 100% rename from tmk_core/common/bootloader.h rename to platforms/bootloader.h diff --git a/tmk_core/common/chibios/_timer.h b/platforms/chibios/_timer.h similarity index 100% rename from tmk_core/common/chibios/_timer.h rename to platforms/chibios/_timer.h diff --git a/tmk_core/common/chibios/_wait.c b/platforms/chibios/_wait.c similarity index 100% rename from tmk_core/common/chibios/_wait.c rename to platforms/chibios/_wait.c diff --git a/tmk_core/common/chibios/_wait.h b/platforms/chibios/_wait.h similarity index 100% rename from tmk_core/common/chibios/_wait.h rename to platforms/chibios/_wait.h diff --git a/tmk_core/common/chibios/atomic_util.h b/platforms/chibios/atomic_util.h similarity index 100% rename from tmk_core/common/chibios/atomic_util.h rename to platforms/chibios/atomic_util.h diff --git a/tmk_core/common/chibios/bootloader.c b/platforms/chibios/bootloader.c similarity index 100% rename from tmk_core/common/chibios/bootloader.c rename to platforms/chibios/bootloader.c diff --git a/tmk_core/common/chibios/chibios_config.h b/platforms/chibios/chibios_config.h similarity index 100% rename from tmk_core/common/chibios/chibios_config.h rename to platforms/chibios/chibios_config.h diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/platforms/chibios/eeprom_stm32.c similarity index 100% rename from tmk_core/common/chibios/eeprom_stm32.c rename to platforms/chibios/eeprom_stm32.c diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/platforms/chibios/eeprom_stm32.h similarity index 100% rename from tmk_core/common/chibios/eeprom_stm32.h rename to platforms/chibios/eeprom_stm32.h diff --git a/tmk_core/common/chibios/eeprom_stm32_defs.h b/platforms/chibios/eeprom_stm32_defs.h similarity index 100% rename from tmk_core/common/chibios/eeprom_stm32_defs.h rename to platforms/chibios/eeprom_stm32_defs.h diff --git a/tmk_core/common/chibios/eeprom_teensy.c b/platforms/chibios/eeprom_teensy.c similarity index 100% rename from tmk_core/common/chibios/eeprom_teensy.c rename to platforms/chibios/eeprom_teensy.c diff --git a/tmk_core/common/chibios/flash_stm32.c b/platforms/chibios/flash_stm32.c similarity index 100% rename from tmk_core/common/chibios/flash_stm32.c rename to platforms/chibios/flash_stm32.c diff --git a/tmk_core/common/chibios/flash_stm32.h b/platforms/chibios/flash_stm32.h similarity index 100% rename from tmk_core/common/chibios/flash_stm32.h rename to platforms/chibios/flash_stm32.h diff --git a/tmk_core/common/chibios/gd32v_compatibility.h b/platforms/chibios/gd32v_compatibility.h similarity index 100% rename from tmk_core/common/chibios/gd32v_compatibility.h rename to platforms/chibios/gd32v_compatibility.h diff --git a/tmk_core/common/chibios/gpio.h b/platforms/chibios/gpio.h similarity index 100% rename from tmk_core/common/chibios/gpio.h rename to platforms/chibios/gpio.h diff --git a/tmk_core/common/chibios/pin_defs.h b/platforms/chibios/pin_defs.h similarity index 100% rename from tmk_core/common/chibios/pin_defs.h rename to platforms/chibios/pin_defs.h diff --git a/tmk_core/common/chibios/platform.c b/platforms/chibios/platform.c similarity index 100% rename from tmk_core/common/chibios/platform.c rename to platforms/chibios/platform.c diff --git a/tmk_core/chibios.mk b/platforms/chibios/platform.mk similarity index 100% rename from tmk_core/chibios.mk rename to platforms/chibios/platform.mk diff --git a/tmk_core/common/chibios/platform_deps.h b/platforms/chibios/platform_deps.h similarity index 100% rename from tmk_core/common/chibios/platform_deps.h rename to platforms/chibios/platform_deps.h diff --git a/tmk_core/common/chibios/sleep_led.c b/platforms/chibios/sleep_led.c similarity index 100% rename from tmk_core/common/chibios/sleep_led.c rename to platforms/chibios/sleep_led.c diff --git a/tmk_core/common/chibios/suspend.c b/platforms/chibios/suspend.c similarity index 100% rename from tmk_core/common/chibios/suspend.c rename to platforms/chibios/suspend.c diff --git a/tmk_core/common/chibios/syscall-fallbacks.c b/platforms/chibios/syscall-fallbacks.c similarity index 100% rename from tmk_core/common/chibios/syscall-fallbacks.c rename to platforms/chibios/syscall-fallbacks.c diff --git a/tmk_core/common/chibios/timer.c b/platforms/chibios/timer.c similarity index 100% rename from tmk_core/common/chibios/timer.c rename to platforms/chibios/timer.c diff --git a/tmk_core/common/chibios/wait.c b/platforms/chibios/wait.c similarity index 100% rename from tmk_core/common/chibios/wait.c rename to platforms/chibios/wait.c diff --git a/platforms/common.mk b/platforms/common.mk new file mode 100644 index 000000000000..f7a0fc7028b7 --- /dev/null +++ b/platforms/common.mk @@ -0,0 +1,12 @@ +PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY) + +TMK_COMMON_SRC += \ + $(PLATFORM_COMMON_DIR)/platform.c \ + $(PLATFORM_COMMON_DIR)/suspend.c \ + $(PLATFORM_COMMON_DIR)/timer.c \ + $(PLATFORM_COMMON_DIR)/bootloader.c \ + +# Search Path +VPATH += $(PLATFORM_PATH) +VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY) +VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR) diff --git a/tmk_core/common/eeprom.h b/platforms/eeprom.h similarity index 100% rename from tmk_core/common/eeprom.h rename to platforms/eeprom.h diff --git a/tmk_core/common/gpio.h b/platforms/gpio.h similarity index 100% rename from tmk_core/common/gpio.h rename to platforms/gpio.h diff --git a/tmk_core/common/pin_defs.h b/platforms/pin_defs.h similarity index 100% rename from tmk_core/common/pin_defs.h rename to platforms/pin_defs.h diff --git a/tmk_core/common/progmem.h b/platforms/progmem.h similarity index 100% rename from tmk_core/common/progmem.h rename to platforms/progmem.h diff --git a/tmk_core/common/sleep_led.h b/platforms/sleep_led.h similarity index 100% rename from tmk_core/common/sleep_led.h rename to platforms/sleep_led.h diff --git a/tmk_core/common/suspend.h b/platforms/suspend.h similarity index 100% rename from tmk_core/common/suspend.h rename to platforms/suspend.h diff --git a/tmk_core/common/test/_wait.h b/platforms/test/_wait.h similarity index 100% rename from tmk_core/common/test/_wait.h rename to platforms/test/_wait.h diff --git a/tmk_core/common/test/bootloader.c b/platforms/test/bootloader.c similarity index 100% rename from tmk_core/common/test/bootloader.c rename to platforms/test/bootloader.c diff --git a/tmk_core/common/test/eeprom.c b/platforms/test/eeprom.c similarity index 100% rename from tmk_core/common/test/eeprom.c rename to platforms/test/eeprom.c diff --git a/tmk_core/common/test/eeprom_stm32_tests.cpp b/platforms/test/eeprom_stm32_tests.cpp similarity index 100% rename from tmk_core/common/test/eeprom_stm32_tests.cpp rename to platforms/test/eeprom_stm32_tests.cpp diff --git a/tmk_core/common/test/flash_stm32_mock.c b/platforms/test/flash_stm32_mock.c similarity index 100% rename from tmk_core/common/test/flash_stm32_mock.c rename to platforms/test/flash_stm32_mock.c diff --git a/tmk_core/common/test/hal.h b/platforms/test/hal.h similarity index 100% rename from tmk_core/common/test/hal.h rename to platforms/test/hal.h diff --git a/tmk_core/common/test/platform.c b/platforms/test/platform.c similarity index 100% rename from tmk_core/common/test/platform.c rename to platforms/test/platform.c diff --git a/tmk_core/common/test/platform.h b/platforms/test/platform.h similarity index 100% rename from tmk_core/common/test/platform.h rename to platforms/test/platform.h diff --git a/tmk_core/native.mk b/platforms/test/platform.mk similarity index 100% rename from tmk_core/native.mk rename to platforms/test/platform.mk diff --git a/tmk_core/common/test/platform_deps.h b/platforms/test/platform_deps.h similarity index 100% rename from tmk_core/common/test/platform_deps.h rename to platforms/test/platform_deps.h diff --git a/tmk_core/common/test/rules.mk b/platforms/test/rules.mk similarity index 78% rename from tmk_core/common/test/rules.mk rename to platforms/test/rules.mk index 73d2302da775..66b853d8eeb1 100644 --- a/tmk_core/common/test/rules.mk +++ b/platforms/test/rules.mk @@ -11,14 +11,14 @@ eeprom_stm32_large_DEFS := $(eeprom_stm32_DEFS) \ -DFEE_PAGE_COUNT=16 eeprom_stm32_INC := \ - $(TMK_PATH)/common/chibios/ + $(PLATFORM_PATH)/chibios/ eeprom_stm32_tiny_INC := $(eeprom_stm32_INC) eeprom_stm32_large_INC := $(eeprom_stm32_INC) eeprom_stm32_SRC := \ $(TOP_DIR)/drivers/eeprom/eeprom_driver.c \ - $(TMK_PATH)/common/test/eeprom_stm32_tests.cpp \ - $(TMK_PATH)/common/test/flash_stm32_mock.c \ - $(TMK_PATH)/common/chibios/eeprom_stm32.c + $(PLATFORM_PATH)/$(PLATFORM_KEY)/eeprom_stm32_tests.cpp \ + $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash_stm32_mock.c \ + $(PLATFORM_PATH)/chibios/eeprom_stm32.c eeprom_stm32_tiny_SRC := $(eeprom_stm32_SRC) eeprom_stm32_large_SRC := $(eeprom_stm32_SRC) diff --git a/tmk_core/common/test/suspend.c b/platforms/test/suspend.c similarity index 100% rename from tmk_core/common/test/suspend.c rename to platforms/test/suspend.c diff --git a/tmk_core/common/test/testlist.mk b/platforms/test/testlist.mk similarity index 100% rename from tmk_core/common/test/testlist.mk rename to platforms/test/testlist.mk diff --git a/tmk_core/common/test/timer.c b/platforms/test/timer.c similarity index 100% rename from tmk_core/common/test/timer.c rename to platforms/test/timer.c diff --git a/tmk_core/common/timer.h b/platforms/timer.h similarity index 100% rename from tmk_core/common/timer.h rename to platforms/timer.h diff --git a/tmk_core/common/wait.h b/platforms/wait.h similarity index 100% rename from tmk_core/common/wait.h rename to platforms/wait.h diff --git a/quantum/debounce/tests/rules.mk b/quantum/debounce/tests/rules.mk index 66928d7eb638..e908dd6f67e1 100644 --- a/quantum/debounce/tests/rules.mk +++ b/quantum/debounce/tests/rules.mk @@ -16,7 +16,7 @@ DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5 DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \ - $(TMK_PATH)/common/test/timer.c + $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c debounce_sym_defer_g_DEFS := $(DEBOUNCE_COMMON_DEFS) debounce_sym_defer_g_SRC := $(DEBOUNCE_COMMON_SRC) \ diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index b7a9f2662ccd..f5525576d828 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -16,7 +16,7 @@ #include "config.h" #include "keymap.h" // to get keymaps[][][] -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "progmem.h" // to read default from flash #include "quantum.h" // for send_string() #include "dynamic_keymap.h" diff --git a/quantum/sequencer/tests/rules.mk b/quantum/sequencer/tests/rules.mk index 87a204669c21..a3bbd80513cc 100644 --- a/quantum/sequencer/tests/rules.mk +++ b/quantum/sequencer/tests/rules.mk @@ -8,4 +8,4 @@ sequencer_SRC := \ $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ $(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \ $(QUANTUM_PATH)/sequencer/sequencer.c \ - $(TMK_PATH)/common/test/timer.c + $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c diff --git a/quantum/via.c b/quantum/via.c index 1b2dbcf08d93..7c8aa753e762 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -44,7 +44,7 @@ #include "raw_hid.h" #include "dynamic_keymap.h" -#include "tmk_core/common/eeprom.h" +#include "eeprom.h" #include "version.h" // for QMK_BUILDDATE used in EEPROM magic #include "via_ensure_keycode.h" diff --git a/testlist.mk b/testlist.mk index 364fb339c60c..faff4d201c96 100644 --- a/testlist.mk +++ b/testlist.mk @@ -1,9 +1,9 @@ TEST_LIST = $(notdir $(patsubst %/rules.mk,%,$(wildcard $(ROOT_DIR)/tests/*/rules.mk))) FULL_TESTS := $(TEST_LIST) -include $(ROOT_DIR)/quantum/debounce/tests/testlist.mk -include $(ROOT_DIR)/quantum/sequencer/tests/testlist.mk -include $(ROOT_DIR)/tmk_core/common/test/testlist.mk +include $(QUANTUM_PATH)/debounce/tests/testlist.mk +include $(QUANTUM_PATH)/sequencer/tests/testlist.mk +include $(PLATFORM_PATH)/test/testlist.mk define VALIDATE_TEST_LIST ifneq ($1,) diff --git a/tmk_core/common.mk b/tmk_core/common.mk deleted file mode 100644 index 555b942c9da7..000000000000 --- a/tmk_core/common.mk +++ /dev/null @@ -1,16 +0,0 @@ -COMMON_DIR = common -PLATFORM_COMMON_DIR = $(COMMON_DIR)/$(PLATFORM_KEY) - -TMK_COMMON_SRC += \ - $(PLATFORM_COMMON_DIR)/platform.c \ - $(PLATFORM_COMMON_DIR)/suspend.c \ - $(PLATFORM_COMMON_DIR)/timer.c \ - $(PLATFORM_COMMON_DIR)/bootloader.c \ - -# Use platform provided print if it exists --include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk - -# Search Path -VPATH += $(TMK_PATH)/$(COMMON_DIR) -VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) -VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR) diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index a8723e6b2e44..31a6de76f104 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -1,5 +1,3 @@ -PROTOCOL_DIR = protocol - TMK_COMMON_SRC += \ $(PROTOCOL_DIR)/host.c \ $(PROTOCOL_DIR)/report.c \ diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index e657af3f4308..6767a8e4af87 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -479,7 +479,7 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) SIZE_MARGIN = 1024 check-size: - $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE)))