MCU_ORIG := $(MCU)
ifneq ($(findstring MKL26Z64, $(MCU)),)
MCU = cortex-m0plus
ARMV = 6
MCU_FAMILY = KINETIS
MCU_SERIES = KL2x
MCU_LDSCRIPT ?= MKL26Z64
MCU_STARTUP ?= kl2x
BOARD ?= PJRC_TEENSY_LC
endif
ifneq ($(findstring MK20DX128, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = KINETIS
MCU_SERIES = K20x
MCU_LDSCRIPT ?= MK20DX128
MCU_STARTUP ?= k20x5
BOARD ?= PJRC_TEENSY_3
endif
ifneq ($(findstring MK20DX256, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = KINETIS
MCU_SERIES = K20x
MCU_LDSCRIPT ?= MK20DX256
MCU_STARTUP ?= k20x7
BOARD ?= PJRC_TEENSY_3_1
endif
ifneq ($(findstring MK66F18, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = KINETIS
MCU_SERIES = MK66F18
MCU_LDSCRIPT ?= MK66FX1M0
MCU_STARTUP ?= MK66F18
BOARD ?= PJRC_TEENSY_3_6
endif
ifneq ($(findstring STM32F042, $(MCU)),)
MCU = cortex-m0
ARMV = 6
MCU_FAMILY = STM32
MCU_SERIES = STM32F0xx
MCU_LDSCRIPT ?= STM32F042x6
MCU_STARTUP ?= stm32f0xx
BOARD ?= GENERIC_STM32_F042X6
USE_FPU ?= no
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F0
endif
ifneq ($(findstring STM32F072, $(MCU)),)
MCU = cortex-m0
ARMV = 6
MCU_FAMILY = STM32
MCU_SERIES = STM32F0xx
MCU_LDSCRIPT ?= STM32F072xB
MCU_STARTUP ?= stm32f0xx
BOARD ?= GENERIC_STM32_F072XB
USE_FPU ?= no
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F0
endif
ifneq ($(findstring STM32F103, $(MCU)),)
MCU = cortex-m3
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32F1xx
MCU_LDSCRIPT ?= STM32F103x8
MCU_STARTUP ?= stm32f1xx
BOARD ?= GENERIC_STM32_F103
USE_FPU ?= no
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F1
endif
ifneq ($(findstring STM32F303, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32F3xx
MCU_LDSCRIPT ?= STM32F303xC
MCU_STARTUP ?= stm32f3xx
BOARD ?= GENERIC_STM32_F303XC
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F3
endif
ifneq ($(findstring STM32F401, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
MCU_LDSCRIPT ?= STM32F401xC
MCU_STARTUP ?= stm32f4xx
BOARD ?= BLACKPILL_STM32_F401
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F411, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
MCU_LDSCRIPT ?= STM32F411xE_tinyuf2
FIRMWARE_FORMAT ?= uf2
else
MCU_LDSCRIPT ?= STM32F411xE
endif
MCU_STARTUP ?= stm32f4xx
BOARD ?= BLACKPILL_STM32_F411
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F446, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
MCU_LDSCRIPT ?= STM32F446xE
MCU_STARTUP ?= stm32f4xx
BOARD ?= GENERIC_STM32_F446XE
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifneq ($(findstring STM32G431, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32G4xx
MCU_LDSCRIPT ?= STM32G431xB
MCU_STARTUP ?= stm32g4xx
BOARD ?= GENERIC_STM32_G431XB
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32G4
endif
ifneq ($(findstring STM32G474, $(MCU)),)
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32G4xx
MCU_LDSCRIPT ?= STM32G474xE
MCU_STARTUP ?= stm32g4xx
BOARD ?= GENERIC_STM32_G474XE
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32G4
endif
ifneq (,$(filter $(MCU),STM32L433 STM32L443))
MCU = cortex-m4
ARMV = 7
MCU_FAMILY = STM32
MCU_SERIES = STM32L4xx
MCU_LDSCRIPT ?= STM32L432xC
MCU_STARTUP ?= stm32l4xx
BOARD ?= GENERIC_STM32_L433XC
PLATFORM_NAME ?= platform_l432
USE_FPU ?= yes
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
UF2_FAMILY ?= STM32L4
endif
ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))
PROTOCOL = LUFA
F_CPU ?= 16000000
ARCH = AVR8
F_USB ?= $(F_CPU)
ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
endif
ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2))
NO_I2C = yes
endif
endif
ifneq (,$(filter $(MCU),atmega32a))
AVRDUDE_MCU = m32
PROTOCOL = VUSB
F_CPU ?= 12000000
endif
ifneq (,$(filter $(MCU),atmega328p))
AVRDUDE_MCU = m328p
PROTOCOL = VUSB
F_CPU ?= 16000000
endif
ifneq (,$(filter $(MCU),atmega328))
AVRDUDE_MCU = m328
PROTOCOL = VUSB
F_CPU ?= 16000000
endif
ifneq (,$(filter $(MCU),attiny85))
PROTOCOL = VUSB
F_CPU ?= 16500000
endif