]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - bootloader.mk
[Keyboard] Added workaround for serial.c/LTO issue for helix/rev2 and helix/pico...
[qmk_firmware.git] / bootloader.mk
index 55352f3d4265cc9a702b533fcdcdb5e127af87eb..d615533947bedf09d6ec50cfa604d0ad1b148012 100644 (file)
 #
 # Sets the bootloader defined in the keyboard's/keymap's rules.mk
 # Current options:
-#   atmel-dfu
-#   lufa-dfu
-#   qmk-dfu
-#   halfkay
-#   caterina
-#   bootloadHID
+#
+# 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)
 #
 # BOOTLOADER_SIZE can still be defined manually, but it's recommended
 # you add any possible configuration to this list
 ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
     OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
     OPT_DEFS += -DBOOTLOADER_DFU
-    BOOTLOADER_SIZE = 4096
+    ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+        BOOTLOADER_SIZE = 4096
+    endif
+    ifeq ($(strip $(MCU)), at90usb1286)
+        BOOTLOADER_SIZE = 8192
+    endif
 endif
 ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
     OPT_DEFS += -DBOOTLOADER_LUFA_DFU
     OPT_DEFS += -DBOOTLOADER_DFU
-    BOOTLOADER_SIZE = 4096
+    ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+        BOOTLOADER_SIZE = 4096
+    endif
+    ifeq ($(strip $(MCU)), at90usb1286)
+        BOOTLOADER_SIZE = 8192
+    endif
 endif
 ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
     OPT_DEFS += -DBOOTLOADER_QMK_DFU
     OPT_DEFS += -DBOOTLOADER_DFU
-    BOOTLOADER_SIZE = 4096
+    ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+        BOOTLOADER_SIZE = 4096
+    endif
+    ifeq ($(strip $(MCU)), at90usb1286)
+        BOOTLOADER_SIZE = 8192
+    endif
 endif
 ifeq ($(strip $(BOOTLOADER)), halfkay)
     OPT_DEFS += -DBOOTLOADER_HALFKAY
-    BOOTLOADER_SIZE = 512
+    ifeq ($(strip $(MCU)), atmega32u4)
+        BOOTLOADER_SIZE = 512
+    endif
+    ifeq ($(strip $(MCU)), at90usb1286)
+        BOOTLOADER_SIZE = 1024
+    endif
 endif
 ifeq ($(strip $(BOOTLOADER)), caterina)
     OPT_DEFS += -DBOOTLOADER_CATERINA
@@ -56,7 +78,11 @@ ifeq ($(strip $(BOOTLOADER)), bootloadHID)
     OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
     BOOTLOADER_SIZE = 4096
 endif
+ifeq ($(strip $(BOOTLOADER)), USBasp)
+    OPT_DEFS += -DBOOTLOADER_USBASP
+    BOOTLOADER_SIZE = 4096
+endif
 
 ifdef BOOTLOADER_SIZE
     OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
-endif
\ No newline at end of file
+endif