rgblight split transfer non-eeprom config (#5396)
[jackhill/qmk/firmware.git] / bootloader.mk
CommitLineData
9fdc2762
JH
1# Copyright 2017 Jack Humbert
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16# If it's possible that multiple bootloaders can be used for one project,
17# you can leave this unset, and the correct size will be selected
18# automatically.
19#
20# Sets the bootloader defined in the keyboard's/keymap's rules.mk
21# Current options:
22# atmel-dfu
23# lufa-dfu
24# qmk-dfu
25# halfkay
26# caterina
27# bootloadHID
28#
29# BOOTLOADER_SIZE can still be defined manually, but it's recommended
30# you add any possible configuration to this list
31
32ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
33 OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
34 OPT_DEFS += -DBOOTLOADER_DFU
14b7602a
JH
35 ifeq ($(strip $(MCU)), atmega32u4)
36 BOOTLOADER_SIZE = 4096
37 endif
38 ifeq ($(strip $(MCU)), at90usb1286)
39 BOOTLOADER_SIZE = 8192
40 endif
9fdc2762
JH
41endif
42ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
43 OPT_DEFS += -DBOOTLOADER_LUFA_DFU
44 OPT_DEFS += -DBOOTLOADER_DFU
14b7602a
JH
45 ifeq ($(strip $(MCU)), atmega32u4)
46 BOOTLOADER_SIZE = 4096
47 endif
48 ifeq ($(strip $(MCU)), at90usb1286)
49 BOOTLOADER_SIZE = 8192
50 endif
9fdc2762
JH
51endif
52ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
53 OPT_DEFS += -DBOOTLOADER_QMK_DFU
54 OPT_DEFS += -DBOOTLOADER_DFU
14b7602a
JH
55 ifeq ($(strip $(MCU)), atmega32u4)
56 BOOTLOADER_SIZE = 4096
57 endif
58 ifeq ($(strip $(MCU)), at90usb1286)
59 BOOTLOADER_SIZE = 8192
60 endif
9fdc2762
JH
61endif
62ifeq ($(strip $(BOOTLOADER)), halfkay)
63 OPT_DEFS += -DBOOTLOADER_HALFKAY
6bd2b8de
DJ
64 ifeq ($(strip $(MCU)), atmega32u4)
65 BOOTLOADER_SIZE = 512
66 endif
67 ifeq ($(strip $(MCU)), at90usb1286)
68 BOOTLOADER_SIZE = 1024
69 endif
9fdc2762
JH
70endif
71ifeq ($(strip $(BOOTLOADER)), caterina)
72 OPT_DEFS += -DBOOTLOADER_CATERINA
73 BOOTLOADER_SIZE = 4096
74endif
75ifeq ($(strip $(BOOTLOADER)), bootloadHID)
76 OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
77 BOOTLOADER_SIZE = 4096
78endif
79
80ifdef BOOTLOADER_SIZE
81 OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
14b7602a 82endif