aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-09-27 20:33:03 +1000
committerGitHub <noreply@github.com>2020-09-27 20:33:03 +1000
commit70fce6564fe691912387d09344efa1d1ce5b949e (patch)
tree42d9b87a3c1c2f22ca2722645c946a96bcad4795
parent28ff51175b6d45ce5a8dbfe7ed6e7a12df3bc8a8 (diff)
downloadqmk_firmware-70fce6564fe691912387d09344efa1d1ce5b949e.tar.gz
qmk_firmware-70fce6564fe691912387d09344efa1d1ce5b949e.zip
Add logic for AT90USBxx7 where needed (#10203)
-rw-r--r--bootloader.mk12
-rw-r--r--lib/python/qmk/constants.py2
-rw-r--r--quantum/config_common.h4
-rw-r--r--quantum/keymap.h4
-rw-r--r--quantum/mcu_selection.mk2
5 files changed, 14 insertions, 10 deletions
diff --git a/bootloader.mk b/bootloader.mk
index d5f803f89..a7e596e47 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -35,30 +35,30 @@
35ifeq ($(strip $(BOOTLOADER)), atmel-dfu) 35ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
36 OPT_DEFS += -DBOOTLOADER_ATMEL_DFU 36 OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
37 OPT_DEFS += -DBOOTLOADER_DFU 37 OPT_DEFS += -DBOOTLOADER_DFU
38 ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4)) 38 ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
39 BOOTLOADER_SIZE = 4096 39 BOOTLOADER_SIZE = 4096
40 endif 40 endif
41 ifeq ($(strip $(MCU)), at90usb1286) 41 ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
42 BOOTLOADER_SIZE = 8192 42 BOOTLOADER_SIZE = 8192
43 endif 43 endif
44endif 44endif
45ifeq ($(strip $(BOOTLOADER)), lufa-dfu) 45ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
46 OPT_DEFS += -DBOOTLOADER_LUFA_DFU 46 OPT_DEFS += -DBOOTLOADER_LUFA_DFU
47 OPT_DEFS += -DBOOTLOADER_DFU 47 OPT_DEFS += -DBOOTLOADER_DFU
48 ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4)) 48 ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
49 BOOTLOADER_SIZE = 4096 49 BOOTLOADER_SIZE = 4096
50 endif 50 endif
51 ifeq ($(strip $(MCU)), at90usb1286) 51 ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
52 BOOTLOADER_SIZE = 8192 52 BOOTLOADER_SIZE = 8192
53 endif 53 endif
54endif 54endif
55ifeq ($(strip $(BOOTLOADER)), qmk-dfu) 55ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
56 OPT_DEFS += -DBOOTLOADER_QMK_DFU 56 OPT_DEFS += -DBOOTLOADER_QMK_DFU
57 OPT_DEFS += -DBOOTLOADER_DFU 57 OPT_DEFS += -DBOOTLOADER_DFU
58 ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4)) 58 ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
59 BOOTLOADER_SIZE = 4096 59 BOOTLOADER_SIZE = 4096
60 endif 60 endif
61 ifeq ($(strip $(MCU)), at90usb1286) 61 ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
62 BOOTLOADER_SIZE = 8192 62 BOOTLOADER_SIZE = 8192
63 endif 63 endif
64endif 64endif
diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py
index 0a4708e4c..0450724df 100644
--- a/lib/python/qmk/constants.py
+++ b/lib/python/qmk/constants.py
@@ -10,6 +10,6 @@ MAX_KEYBOARD_SUBFOLDERS = 5
10 10
11# Supported processor types 11# Supported processor types
12ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F411' 12ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F411'
13AVR_PROCESSORS = 'at90usb1286', 'at90usb646', 'atmega16u2', 'atmega328p', 'atmega32a', 'atmega32u2', 'atmega32u4', None 13AVR_PROCESSORS = 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', 'atmega328p', 'atmega32a', None
14ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS 14ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS
15VUSB_PROCESSORS = 'atmega328p', 'atmega32a', 'atmega328', 'attiny85' 15VUSB_PROCESSORS = 'atmega328p', 'atmega32a', 'atmega328', 'attiny85'
diff --git a/quantum/config_common.h b/quantum/config_common.h
index 84edc4639..c1e6698e5 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -44,7 +44,7 @@
44# define PINB_ADDRESS 0x3 44# define PINB_ADDRESS 0x3
45# define PINC_ADDRESS 0x6 45# define PINC_ADDRESS 0x6
46# define PIND_ADDRESS 0x9 46# define PIND_ADDRESS 0x9
47# elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) 47# elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
48# define ADDRESS_BASE 0x00 48# define ADDRESS_BASE 0x00
49# define PINA_ADDRESS 0x0 49# define PINA_ADDRESS 0x0
50# define PINB_ADDRESS 0x3 50# define PINB_ADDRESS 0x3
@@ -307,7 +307,7 @@
307 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ 307 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
308 sei(); \ 308 sei(); \
309 } while (0) 309 } while (0)
310# elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) 310# elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
311# define SERIAL_UART_BAUD 115200 311# define SERIAL_UART_BAUD 115200
312# define SERIAL_UART_DATA UDR1 312# define SERIAL_UART_DATA UDR1
313/* UBRR should result in ~16 and set UCSR1A = _BV(U2X1) as per rn42 documentation. HC05 needs baudrate configured accordingly */ 313/* UBRR should result in ~16 and set UCSR1A = _BV(U2X1) as per rn42 documentation. HC05 needs baudrate configured accordingly */
diff --git a/quantum/keymap.h b/quantum/keymap.h
index 34a9c8f8c..de3bece11 100644
--- a/quantum/keymap.h
+++ b/quantum/keymap.h
@@ -40,6 +40,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
40#if defined(PROTOCOL_CHIBIOS) 40#if defined(PROTOCOL_CHIBIOS)
41# define RESET QK_RESET 41# define RESET QK_RESET
42#endif 42#endif
43// Gross hack, remove me and change RESET keycode to QK_BOOT
44#if defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__)
45# undef RESET
46#endif
43 47
44#include "quantum_keycodes.h" 48#include "quantum_keycodes.h"
45 49
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index 6ec5dff5f..295dfd318 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -280,7 +280,7 @@ ifneq ($(findstring STM32F411, $(MCU)),)
280 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 280 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
281endif 281endif
282 282
283ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286)) 283ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))
284 PROTOCOL = LUFA 284 PROTOCOL = LUFA
285 285
286 # Processor frequency. 286 # Processor frequency.