summaryrefslogtreecommitdiffstats
path: root/builddefs
diff options
context:
space:
mode:
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/bootloader.mk223
-rw-r--r--builddefs/build_keyboard.mk26
-rw-r--r--builddefs/common_features.mk42
-rw-r--r--builddefs/generic_features.mk1
-rw-r--r--builddefs/show_options.mk5
5 files changed, 34 insertions, 263 deletions
diff --git a/builddefs/bootloader.mk b/builddefs/bootloader.mk
deleted file mode 100644
index 9f55536423..0000000000
--- a/builddefs/bootloader.mk
+++ /dev/null
@@ -1,223 +0,0 @@
-# Copyright 2017 Jack Humbert
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# If it's possible that multiple bootloaders can be used for one project,
-# you can leave this unset, and the correct size will be selected
-# automatically.
-#
-# Sets the bootloader defined in the keyboard's/keymap's rules.mk
-# Current options:
-#
-# AVR:
-# halfkay PJRC Teensy
-# caterina Pro Micro (Sparkfun/generic)
-# atmel-dfu Atmel factory DFU
-# lufa-dfu LUFA DFU
-# qmk-dfu QMK DFU (LUFA + blinkenlight)
-# qmk-hid QMK HID (LUFA + blinkenlight)
-# bootloadhid HIDBootFlash compatible (ATmega32A)
-# usbasploader USBaspLoader (ATmega328P)
-# ARM:
-# halfkay PJRC Teensy
-# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
-# stm32duino STM32Duino (STM32F103x8)
-# stm32-dfu STM32 USB DFU in ROM
-# apm32-dfu APM32 USB DFU in ROM
-# RISC-V:
-# gd32v-dfu GD32V USB DFU in ROM
-#
-# If you need to provide your own implementation, you can set inside `rules.mk`
-# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See
-# the respective file under `platforms/<PLATFORM>/bootloaders/custom.c` to see
-# which functions may be overridden.
-#
-# BOOTLOADER_SIZE can still be defined manually, but it's recommended
-# you add any possible configuration to this list
-
-ifeq ($(strip $(BOOTLOADER)), custom)
- OPT_DEFS += -DBOOTLOADER_CUSTOM
- BOOTLOADER_TYPE = custom
-endif
-ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
- OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
- OPT_DEFS += -DBOOTLOADER_DFU
- BOOTLOADER_TYPE = dfu
-
- ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
- BOOTLOADER_SIZE = 4096
- endif
- ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
- BOOTLOADER_SIZE = 8192
- endif
-endif
-ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
- OPT_DEFS += -DBOOTLOADER_LUFA_DFU
- OPT_DEFS += -DBOOTLOADER_DFU
- BOOTLOADER_TYPE = dfu
-
- ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
- BOOTLOADER_SIZE ?= 4096
- endif
- ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
- BOOTLOADER_SIZE ?= 8192
- endif
-endif
-ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
- OPT_DEFS += -DBOOTLOADER_QMK_DFU
- OPT_DEFS += -DBOOTLOADER_DFU
- BOOTLOADER_TYPE = dfu
-
- ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
- BOOTLOADER_SIZE ?= 4096
- endif
- ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
- BOOTLOADER_SIZE ?= 8192
- endif
-endif
-ifeq ($(strip $(BOOTLOADER)), qmk-hid)
- OPT_DEFS += -DBOOTLOADER_QMK_HID
- OPT_DEFS += -DBOOTLOADER_HID
- BOOTLOADER_TYPE = dfu
-
- BOOTLOADER_SIZE ?= 4096
-endif
-ifeq ($(strip $(BOOTLOADER)), halfkay)
- OPT_DEFS += -DBOOTLOADER_HALFKAY
- BOOTLOADER_TYPE = halfkay
-
- # Teensy 2.0
- ifeq ($(strip $(MCU)), atmega32u4)
- BOOTLOADER_SIZE = 512
- endif
- # Teensy 2.0++
- ifeq ($(strip $(MCU)), at90usb1286)
- BOOTLOADER_SIZE = 1024
- endif
- # Teensy LC, 3.0, 3.1/2, 3.5, 3.6
- ifneq (,$(filter $(MCU_ORIG), MKL26Z64 MK20DX128 MK20DX256 MK64FX512 MK66FX1M0))
- FIRMWARE_FORMAT = hex
- endif
-endif
-ifeq ($(strip $(BOOTLOADER)), caterina)
- OPT_DEFS += -DBOOTLOADER_CATERINA
- BOOTLOADER_TYPE = caterina
-
- BOOTLOADER_SIZE = 4096
-endif
-ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID))
- OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
- BOOTLOADER_TYPE = bootloadhid
-
- BOOTLOADER_SIZE = 4096
-endif
-ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp))
- OPT_DEFS += -DBOOTLOADER_USBASP
- BOOTLOADER_TYPE = usbasploader
-
- BOOTLOADER_SIZE = 4096
-endif
-ifeq ($(strip $(BOOTLOADER)), lufa-ms)
- OPT_DEFS += -DBOOTLOADER_MS
- BOOTLOADER_TYPE = dfu
-
- BOOTLOADER_SIZE ?= 8192
- FIRMWARE_FORMAT = bin
-cpfirmware: lufa_warning
-.INTERMEDIATE: lufa_warning
-lufa_warning: $(FIRMWARE_FORMAT)
- $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
- $(info LUFA MASS STORAGE Bootloader selected)
- $(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!)
- $(info It is extremely prone to bricking, and is only included to support existing boards.)
- $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
-endif
-ifdef BOOTLOADER_SIZE
- OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
-endif
-
-ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
- OPT_DEFS += -DBOOTLOADER_STM32_DFU
- BOOTLOADER_TYPE = stm32_dfu
-
- # Options to pass to dfu-util when flashing
- DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
- DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
-endif
-ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
- OPT_DEFS += -DBOOTLOADER_APM32_DFU
- BOOTLOADER_TYPE = stm32_dfu
-
- # Options to pass to dfu-util when flashing
- DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
- DFU_SUFFIX_ARGS ?= -v 314B -p 0106
-endif
-ifeq ($(strip $(BOOTLOADER)), gd32v-dfu)
- OPT_DEFS += -DBOOTLOADER_GD32V_DFU
- BOOTLOADER_TYPE = gd32v_dfu
-
- # Options to pass to dfu-util when flashing
- DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave
- DFU_SUFFIX_ARGS ?= -v 28E9 -p 0189
-endif
-ifeq ($(strip $(BOOTLOADER)), kiibohd)
- OPT_DEFS += -DBOOTLOADER_KIIBOHD
- BOOTLOADER_TYPE = kiibohd
-
- ifeq ($(strip $(MCU_ORIG)), MK20DX128)
- MCU_LDSCRIPT = MK20DX128BLDR4
- endif
- ifeq ($(strip $(MCU_ORIG)), MK20DX256)
- MCU_LDSCRIPT = MK20DX256BLDR8
- endif
-
- # Options to pass to dfu-util when flashing
- DFU_ARGS = -d 1C11:B007
- DFU_SUFFIX_ARGS = -v 1C11 -p B007
-endif
-ifeq ($(strip $(BOOTLOADER)), stm32duino)
- OPT_DEFS += -DBOOTLOADER_STM32DUINO
- MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
- BOARD = STM32_F103_STM32DUINO
- BOOTLOADER_TYPE = stm32duino
-
- # Options to pass to dfu-util when flashing
- DFU_ARGS = -d 1EAF:0003 -a 2 -R
- DFU_SUFFIX_ARGS = -v 1EAF -p 0003
-endif
-ifeq ($(strip $(BOOTLOADER)), tinyuf2)
- OPT_DEFS += -DBOOTLOADER_TINYUF2
- BOOTLOADER_TYPE = tinyuf2
- FIRMWARE_FORMAT = uf2
-endif
-ifeq ($(strip $(BOOTLOADER)), rp2040)
- OPT_DEFS += -DBOOTLOADER_RP2040
- BOOTLOADER_TYPE = rp2040
-endif
-ifeq ($(strip $(BOOTLOADER)), halfkay)
- OPT_DEFS += -DBOOTLOADER_HALFKAY
- BOOTLOADER_TYPE = halfkay
-endif
-ifeq ($(strip $(BOOTLOADER)), md-boot)
- OPT_DEFS += -DBOOTLOADER_MD_BOOT
- BOOTLOADER_TYPE = md_boot
-endif
-ifeq ($(strip $(BOOTLOADER)), wb32-dfu)
- OPT_DEFS += -DBOOTLOADER_WB32_DFU
- BOOTLOADER_TYPE = wb32_dfu
-endif
-
-ifeq ($(strip $(BOOTLOADER_TYPE)),)
- $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate 'BOOTLOADER' in your keyboard's 'rules.mk' file.)
-endif
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index fe95dcaf15..91cd851ef6 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -241,21 +241,20 @@ endif
#
# https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic
#
-QMK_KEYBOARD_H = $(KEYBOARD_OUTPUT)/src/default_keyboard.h
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
- QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
+ FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).h)","")
- QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h
+ FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).h)","")
- QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h
+ FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).h)","")
- QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h
+ FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
- QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
+ FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
endif
# Determine and set parameters based on the keyboard's processor family.
@@ -329,7 +328,7 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
endif
-CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
+CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h
KEYBOARD_SRC += $(KEYBOARD_OUTPUT)/src/default_keyboard.c
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
@@ -344,15 +343,10 @@ $(KEYBOARD_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
$(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
- $(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h)
+ $(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h)
@$(BUILD_CMD)
-$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
- @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
- $(eval CMD=$(QMK_BIN) generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h)
- @$(BUILD_CMD)
-
-generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h $(KEYBOARD_OUTPUT)/src/layouts.h
+generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h
.INTERMEDIATE : generated-files
@@ -428,7 +422,6 @@ include $(BUILDDEFS_PATH)/common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/protocol.mk
include $(PLATFORM_PATH)/common.mk
-include $(BUILDDEFS_PATH)/bootloader.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
@@ -443,6 +436,7 @@ ifneq ($(REQUIRE_PLATFORM_KEY),)
endif
endif
+-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
@@ -471,7 +465,7 @@ ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
--DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
+-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD_OUTPUT)/src/default_keyboard.h\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\"
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index a23b5e82b9..3d34c673d3 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -773,8 +773,10 @@ endif
ifeq ($(strip $(UNICODE_COMMON)), yes)
OPT_DEFS += -DUNICODE_COMMON_ENABLE
+ COMMON_VPATH += $(QUANTUM_DIR)/unicode
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c \
- $(QUANTUM_DIR)/utf8.c
+ $(QUANTUM_DIR)/unicode/unicode.c \
+ $(QUANTUM_DIR)/unicode/utf8.c
endif
MAGIC_ENABLE ?= yes
@@ -805,31 +807,25 @@ ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes)
OPT_DEFS += -DMOUSE_ENABLE
endif
-ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes)
- PS2_ENABLE := yes
- SRC += ps2_busywait.c
- SRC += ps2_io.c
- OPT_DEFS += -DPS2_USE_BUSYWAIT
-endif
+VALID_PS2_DRIVER_TYPES := busywait interrupt usart vendor
-ifeq ($(strip $(PS2_USE_INT)), yes)
- PS2_ENABLE := yes
- SRC += ps2_interrupt.c
- SRC += ps2_io.c
- OPT_DEFS += -DPS2_USE_INT
-endif
+PS2_DRIVER ?= busywait
+ifeq ($(strip $(PS2_ENABLE)), yes)
+ ifeq ($(filter $(PS2_DRIVER),$(VALID_PS2_DRIVER_TYPES)),)
+ $(call CATASTROPHIC_ERROR,Invalid PS2_DRIVER,PS2_DRIVER="$(PS2_DRIVER)" is not a valid PS/2 driver)
+ endif
-ifeq ($(strip $(PS2_USE_USART)), yes)
- PS2_ENABLE := yes
- SRC += ps2_usart.c
- SRC += ps2_io.c
- OPT_DEFS += -DPS2_USE_USART
-endif
+ OPT_DEFS += -DPS2_DRIVER_$(strip $(shell echo $(PS2_DRIVER) | tr '[:lower:]' '[:upper:]'))
-ifeq ($(strip $(PS2_ENABLE)), yes)
COMMON_VPATH += $(DRIVER_PATH)/ps2
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/ps2
OPT_DEFS += -DPS2_ENABLE
+
+ ifneq ($(strip $(PS2_DRIVER)), vendor)
+ SRC += ps2_io.c
+ endif
+
+ SRC += ps2_$(strip $(PS2_DRIVER)).c
endif
JOYSTICK_ENABLE ?= no
@@ -888,14 +884,14 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
SRC += outputselect.c
ifeq ($(strip $(BLUETOOTH_DRIVER)), BluefruitLE)
- OPT_DEFS += -DBLUETOOTH_BLUEFRUIT_LE
- SRC += analog.c
+ OPT_DEFS += -DBLUETOOTH_BLUEFRUIT_LE -DHAL_USE_SPI=TRUE
SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp
+ QUANTUM_LIB_SRC += analog.c
QUANTUM_LIB_SRC += spi_master.c
endif
ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42)
- OPT_DEFS += -DBLUETOOTH_RN42
+ OPT_DEFS += -DBLUETOOTH_RN42 -DHAL_USE_SERIAL=TRUE
SRC += $(DRIVER_PATH)/bluetooth/rn42.c
QUANTUM_LIB_SRC += uart.c
endif
diff --git a/builddefs/generic_features.mk b/builddefs/generic_features.mk
index f195e9fd75..0d897bc1c8 100644
--- a/builddefs/generic_features.mk
+++ b/builddefs/generic_features.mk
@@ -17,6 +17,7 @@ SPACE_CADET_ENABLE ?= yes
GRAVE_ESC_ENABLE ?= yes
GENERIC_FEATURES = \
+ AUTOCORRECT \
CAPS_WORD \
COMBO \
COMMAND \
diff --git a/builddefs/show_options.mk b/builddefs/show_options.mk
index 98537e6da2..fac6576ba1 100644
--- a/builddefs/show_options.mk
+++ b/builddefs/show_options.mk
@@ -66,7 +66,9 @@ OTHER_OPTION_NAMES = \
KEYLOGGER_ENABLE \
LCD_BACKLIGHT_ENABLE \
MACROS_ENABLED \
+ PS2_ENABLE \
PS2_MOUSE_ENABLE \
+ PS2_DRIVER \
RAW_ENABLE \
SWAP_HANDS_ENABLE \
RING_BUFFERED_6KRO_REPORT_ENABLE \
@@ -82,7 +84,8 @@ OTHER_OPTION_NAMES = \
LTO_ENABLE \
PROGRAMMABLE_BUTTON_ENABLE \
SECURE_ENABLE \
- CAPS_WORD_ENABLE
+ CAPS_WORD_ENABLE \
+ AUTOCORRECT_ENABLE
define NAME_ECHO
@printf " %-30s = %-16s # %s\\n" "$1" "$($1)" "$(origin $1)"