summaryrefslogtreecommitdiff
path: root/bootloader.mk
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader.mk')
-rw-r--r--bootloader.mk68
1 files changed, 41 insertions, 27 deletions
diff --git a/bootloader.mk b/bootloader.mk
index 299639043e..5ba118fb44 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -20,20 +20,20 @@
# 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)
-# bootloadHID HIDBootFlash compatible (ATmega32A)
-# USBasp USBaspLoader (ATmega328P)
+# 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:
-# 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
+# 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
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
@@ -41,33 +41,38 @@
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+ ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
+ ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
- BOOTLOADER_SIZE = 4096
+ ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
+ BOOTLOADER_SIZE ?= 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
- BOOTLOADER_SIZE = 8192
+ ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
+ BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
- BOOTLOADER_SIZE = 4096
+ ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
+ BOOTLOADER_SIZE ?= 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
- BOOTLOADER_SIZE = 8192
+ 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_SIZE ?= 4096
+endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
ifeq ($(strip $(MCU)), atmega32u4)
@@ -81,20 +86,26 @@ ifeq ($(strip $(BOOTLOADER)), caterina)
OPT_DEFS += -DBOOTLOADER_CATERINA
BOOTLOADER_SIZE = 4096
endif
-ifeq ($(strip $(BOOTLOADER)), bootloadHID)
+ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID))
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_SIZE = 4096
endif
-ifeq ($(strip $(BOOTLOADER)), USBasp)
+ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp))
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
- # DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!
- # It is extremely prone to bricking, and is only included to support existing boards.
OPT_DEFS += -DBOOTLOADER_MS
- BOOTLOADER_SIZE = 6144
+ 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))
@@ -138,3 +149,6 @@ ifeq ($(strip $(BOOTLOADER)), stm32duino)
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
+ifeq ($(strip $(BOOTLOADER)), tinyuf2)
+ OPT_DEFS += -DBOOTLOADER_TINYUF2
+endif