Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
commit
fba509780e
@ -0,0 +1,221 @@
|
||||
ifndef VERBOSE
|
||||
.SILENT:
|
||||
endif
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
include common.mk
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
|
||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT)
|
||||
else
|
||||
TARGET ?= $(KEYBOARD)_$(KEYMAP)
|
||||
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
|
||||
endif
|
||||
|
||||
# Force expansion
|
||||
TARGET := $(TARGET)
|
||||
|
||||
|
||||
MASTER ?= left
|
||||
ifdef master
|
||||
MASTER = $(master)
|
||||
endif
|
||||
|
||||
ifeq ($(MASTER),right)
|
||||
OPT_DEFS += -DMASTER_IS_ON_RIGHT
|
||||
else
|
||||
ifneq ($(MASTER),left)
|
||||
$(error MASTER does not have a valid value(left/right))
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
||||
KEYBOARD_PATH := keyboards/$(KEYBOARD)
|
||||
KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_C))","")
|
||||
include $(KEYBOARD_PATH)/rules.mk
|
||||
else
|
||||
$(error "$(KEYBOARD_C)" does not exist)
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
|
||||
SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c
|
||||
ifneq ("$(wildcard $(SUBPROJECT_C))","")
|
||||
OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
|
||||
include $(SUBPROJECT_PATH)/rules.mk
|
||||
else
|
||||
$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
|
||||
endif
|
||||
endif
|
||||
|
||||
# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
|
||||
ifdef MCU_FAMILY
|
||||
PLATFORM=CHIBIOS
|
||||
else
|
||||
PLATFORM=AVR
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),CHIBIOS)
|
||||
include $(TMK_PATH)/protocol/chibios.mk
|
||||
include $(TMK_PATH)/chibios.mk
|
||||
OPT_OS = chibios
|
||||
ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
|
||||
else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
|
||||
OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
|
||||
endif
|
||||
endif
|
||||
|
||||
CONFIG_H = $(KEYBOARD_PATH)/config.h
|
||||
ifneq ($(SUBPROJECT),)
|
||||
ifneq ("$(wildcard $(SUBPROJECT_C))","")
|
||||
CONFIG_H = $(SUBPROJECT_PATH)/config.h
|
||||
endif
|
||||
endif
|
||||
|
||||
# Save the defines and includes here, so we don't include any keymap specific ones
|
||||
PROJECT_DEFS := $(OPT_DEFS)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
|
||||
PROJECT_CONFIG := $(CONFIG_H)
|
||||
|
||||
MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
|
||||
MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
|
||||
SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
|
||||
SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c
|
||||
ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","")
|
||||
-include $(SUBPROJ_KEYMAP_PATH)/Makefile
|
||||
KEYMAP_C := $(SUBPROJ_KEYMAP_C)
|
||||
KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","")
|
||||
-include $(MAIN_KEYMAP_PATH)/Makefile
|
||||
KEYMAP_C := $(MAIN_KEYMAP_C)
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH)
|
||||
else
|
||||
$(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist)
|
||||
endif
|
||||
|
||||
|
||||
# Object files directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
|
||||
|
||||
|
||||
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
CONFIG_H = $(KEYMAP_PATH)/config.h
|
||||
endif
|
||||
|
||||
# # project specific files
|
||||
SRC += $(KEYBOARD_C) \
|
||||
$(KEYMAP_C) \
|
||||
$(QUANTUM_DIR)/quantum.c \
|
||||
$(QUANTUM_DIR)/keymap_common.c \
|
||||
$(QUANTUM_DIR)/keycode_config.c \
|
||||
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SRC += $(SUBPROJECT_C)
|
||||
endif
|
||||
|
||||
ifndef CUSTOM_MATRIX
|
||||
SRC += $(QUANTUM_DIR)/matrix.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
||||
OPT_DEFS += -DMIDI_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||
OPT_DEFS += -DVIRTSER_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(AUDIO_ENABLE)), yes)
|
||||
OPT_DEFS += -DAUDIO_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
|
||||
SRC += $(QUANTUM_DIR)/audio/audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/voices.c
|
||||
SRC += $(QUANTUM_DIR)/audio/luts.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_ENABLE)), yes)
|
||||
OPT_DEFS += -DUNICODE_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/light_ws2812.c
|
||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
OPT_DEFS += -DTAP_DANCE_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
|
||||
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
|
||||
OPT_DEFS += $(SERIAL_DEFS)
|
||||
VAPTH += $(SERIAL_PATH)
|
||||
endif
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
||||
# Search Path
|
||||
VPATH += $(KEYMAP_PATH)
|
||||
ifneq ($(SUBPROJECT),)
|
||||
VPATH += $(SUBPROJECT_PATH)
|
||||
endif
|
||||
VPATH += $(KEYBOARD_PATH)
|
||||
VPATH += $(COMMON_VPATH)
|
||||
|
||||
|
||||
include $(TMK_PATH)/common.mk
|
||||
SRC += $(TMK_COMMON_SRC)
|
||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
||||
|
||||
ifeq ($(PLATFORM),AVR)
|
||||
include $(TMK_PATH)/protocol/lufa.mk
|
||||
include $(TMK_PATH)/avr.mk
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
|
||||
VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
|
||||
include $(VISUALIZER_PATH)/visualizer.mk
|
||||
endif
|
||||
|
||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
||||
$(KEYMAP_OUTPUT)_SRC := $(SRC)
|
||||
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
|
||||
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
|
||||
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
|
||||
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
|
||||
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
|
||||
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
|
||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||
|
||||
# Default target.
|
||||
all: build sizeafter
|
||||
|
||||
# Change the build target to build a HEX file or a library.
|
||||
build: elf hex
|
||||
#build: elf hex eep lss sym
|
||||
#build: lib
|
||||
|
||||
|
||||
include $(TMK_PATH)/rules.mk
|
||||
|
@ -0,0 +1,57 @@
|
||||
ifndef VERBOSE
|
||||
.SILENT:
|
||||
endif
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
include common.mk
|
||||
|
||||
TARGET=test/$(TEST)
|
||||
|
||||
GTEST_OUTPUT = $(BUILD_DIR)/gtest
|
||||
|
||||
TEST_OBJ = $(BUILD_DIR)/test_obj
|
||||
|
||||
OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
|
||||
|
||||
GTEST_INC := \
|
||||
$(LIB_PATH)/googletest/googletest/include\
|
||||
$(LIB_PATH)/googletest/googlemock/include\
|
||||
|
||||
GTEST_INTERNAL_INC :=\
|
||||
$(LIB_PATH)/googletest/googletest\
|
||||
$(LIB_PATH)/googletest/googlemock
|
||||
|
||||
$(GTEST_OUTPUT)_SRC :=\
|
||||
googletest/src/gtest-all.cc\
|
||||
googletest/src/gtest_main.cc\
|
||||
googlemock/src/gmock-all.cc
|
||||
|
||||
$(GTEST_OUTPUT)_DEFS :=
|
||||
$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
|
||||
|
||||
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
|
||||
CREATE_MAP := no
|
||||
|
||||
VPATH +=\
|
||||
$(LIB_PATH)/googletest\
|
||||
$(LIB_PATH)/googlemock
|
||||
|
||||
all: elf
|
||||
|
||||
VPATH += $(COMMON_VPATH)
|
||||
|
||||
include $(TMK_PATH)/common.mk
|
||||
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
|
||||
|
||||
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
|
||||
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
|
||||
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
|
||||
|
||||
include $(TMK_PATH)/native.mk
|
||||
include $(TMK_PATH)/rules.mk
|
||||
|
||||
|
||||
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
||||
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|
||||
|
@ -0,0 +1,26 @@
|
||||
include message.mk
|
||||
|
||||
# Directory common source files exist
|
||||
TOP_DIR = .
|
||||
TMK_DIR = tmk_core
|
||||
TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
|
||||
LIB_PATH = $(TOP_DIR)/lib
|
||||
|
||||
QUANTUM_DIR = quantum
|
||||
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
|
||||
|
||||
BUILD_DIR := $(TOP_DIR)/.build
|
||||
|
||||
SERIAL_DIR := $(QUANTUM_DIR)/serial_link
|
||||
SERIAL_PATH := $(QUANTUM_PATH)/serial_link
|
||||
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
|
||||
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
|
||||
SERIAL_DEFS += -DSERIAL_LINK_ENABLE
|
||||
|
||||
COMMON_VPATH := $(TOP_DIR)
|
||||
COMMON_VPATH += $(TMK_PATH)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
||||
COMMON_VPATH += $(SERIAL_PATH)
|
@ -1,70 +1,3 @@
|
||||
|
||||
|
||||
# Target file name (without extension).
|
||||
|
||||
# project specific files
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u2
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,66 @@
|
||||
|
||||
|
||||
# Target file name (without extension).
|
||||
|
||||
# project specific files
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u2
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
@ -1,70 +1,3 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,66 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,74 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -1,73 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
@ -1,88 +1,3 @@
|
||||
|
||||
|
||||
ifdef TEENSY2
|
||||
OPT_DEFS += -DATREUS_TEENSY2
|
||||
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||
else
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
endif
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
USB ?= /dev/cu.usbmodem1411
|
||||
|
||||
upload: build
|
||||
$(ATREUS_UPLOAD_COMMAND)
|
||||
|
||||
endif
|
@ -0,0 +1,82 @@
|
||||
|
||||
|
||||
ifdef TEENSY2
|
||||
OPT_DEFS += -DATREUS_TEENSY2
|
||||
ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||
else
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
endif
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
USB ?= /dev/cu.usbmodem1411
|
||||
|
||||
upload: build
|
||||
$(ATRUES_UPLOAD_COMMAND)
|
@ -1,72 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
endif
|
@ -0,0 +1,67 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,14 +1,5 @@
|
||||
SUBPROJECT_DEFAULT = stm32_f072_onekey
|
||||
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -1,49 +1,49 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
/**
|
||||
* @brief PAL setup.
|
||||
* @details Digital I/O ports static configuration as defined in @p board.h.
|
||||
* This variable is used by the HAL when initializing the PAL driver.
|
||||
*/
|
||||
#if HAL_USE_PAL || defined(__DOXYGEN__)
|
||||
const PALConfig pal_default_config =
|
||||
{
|
||||
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
|
||||
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
|
||||
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
|
||||
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
|
||||
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Early initialization code.
|
||||
* This initialization must be performed just after stack setup and before
|
||||
* any other initialization.
|
||||
*/
|
||||
void __early_init(void) {
|
||||
|
||||
stm32_clock_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* Board-specific initialization code.
|
||||
*/
|
||||
void boardInit(void) {
|
||||
}
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
/**
|
||||
* @brief PAL setup.
|
||||
* @details Digital I/O ports static configuration as defined in @p board.h.
|
||||
* This variable is used by the HAL when initializing the PAL driver.
|
||||
*/
|
||||
#if HAL_USE_PAL || defined(__DOXYGEN__)
|
||||
const PALConfig pal_default_config =
|
||||
{
|
||||
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
|
||||
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
|
||||
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
|
||||
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
|
||||
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Early initialization code.
|
||||
* This initialization must be performed just after stack setup and before
|
||||
* any other initialization.
|
||||
*/
|
||||
void __early_init(void) {
|
||||
|
||||
stm32_clock_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* Board-specific initialization code.
|
||||
*/
|
||||
void boardInit(void) {
|
||||
}
|
||||
|
@ -1,166 +1,166 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _BOARD_H_
|
||||
#define _BOARD_H_
|
||||
|
||||
/*
|
||||
* Setup for a Generic STM32F103 board.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Board identifier.
|
||||
*/
|
||||
#define BOARD_GENERIC_STM32_F103
|
||||
#define BOARD_NAME "Generic STM32F103x board"
|
||||
|
||||
/*
|
||||
* Board frequencies.
|
||||
*/
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_HSECLK 8000000
|
||||
|
||||
/*
|
||||
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
|
||||
*/
|
||||
#define STM32F103xB
|
||||
|
||||
/*
|
||||
* IO pins assignments
|
||||
*/
|
||||
|
||||
/* on-board */
|
||||
|
||||
#define GPIOC_LED 13
|
||||
#define GPIOD_OSC_IN 0
|
||||
#define GPIOD_OSC_OUT 1
|
||||
|
||||
/* In case your board has a "USB enable" hardware
|
||||
controlled by a pin, define it here. (It could be just
|
||||
a 1.5k resistor connected to D+ line.)
|
||||
*/
|
||||
/*
|
||||
#define GPIOB_USB_DISC 10
|
||||
*/
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
*
|
||||
* The digits have the following meaning:
|
||||
* 0 - Analog input.
|
||||
* 1 - Push Pull output 10MHz.
|
||||
* 2 - Push Pull output 2MHz.
|
||||
* 3 - Push Pull output 50MHz.
|
||||
* 4 - Digital input.
|
||||
* 5 - Open Drain output 10MHz.
|
||||
* 6 - Open Drain output 2MHz.
|
||||
* 7 - Open Drain output 50MHz.
|
||||
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
|
||||
* 9 - Alternate Push Pull output 10MHz.
|
||||
* A - Alternate Push Pull output 2MHz.
|
||||
* B - Alternate Push Pull output 50MHz.
|
||||
* C - Reserved.
|
||||
* D - Alternate Open Drain output 10MHz.
|
||||
* E - Alternate Open Drain output 2MHz.
|
||||
* F - Alternate Open Drain output 50MHz.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Port A setup.
|
||||
* Everything input with pull-up except:
|
||||
* PA2 - Alternate output (USART2 TX).
|
||||
* PA3 - Normal input (USART2 RX).
|
||||
* PA9 - Alternate output (USART1 TX).
|
||||
* PA10 - Normal input (USART1 RX).
|
||||
*/
|
||||
#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */
|
||||
#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */
|
||||
#define VAL_GPIOAODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port B setup.
|
||||
* Everything input with pull-up except:
|
||||
* PB10 - Push Pull output (USB switch).
|
||||
*/
|
||||
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
|
||||
#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */
|
||||
#define VAL_GPIOBODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port C setup.
|
||||
* Everything input with pull-up except:
|
||||
* PC13 - Push Pull output (LED).
|
||||
*/
|
||||
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
|
||||
#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */
|
||||
#define VAL_GPIOCODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port D setup.
|
||||
* Everything input with pull-up except:
|
||||
* PD0 - Normal input (XTAL).
|
||||
* PD1 - Normal input (XTAL).
|
||||
*/
|
||||
#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
|
||||
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
|
||||
#define VAL_GPIODODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port E setup.
|
||||
* Everything input with pull-up except:
|
||||
*/
|
||||
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
|
||||
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
|
||||
#define VAL_GPIOEODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* USB bus activation macro, required by the USB driver.
|
||||
*/
|
||||
/* The point is that most of the generic STM32F103* boards
|
||||
have a 1.5k resistor connected on one end to the D+ line
|
||||
and on the other end to some pin. Or even a slightly more
|
||||
complicated "USB enable" circuit, controlled by a pin.
|
||||
That should go here.
|
||||
|
||||
However on some boards (e.g. one that I have), there's no
|
||||
such hardware. In which case it's better to not do anything.
|
||||
*/
|
||||
/*
|
||||
#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
|
||||
*/
|
||||
#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
|
||||
|
||||
/*
|
||||
* USB bus de-activation macro, required by the USB driver.
|
||||
*/
|
||||
/*
|
||||
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
|
||||
*/
|
||||
#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
|
||||
|
||||
#if !defined(_FROM_ASM_)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void boardInit(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _FROM_ASM_ */
|
||||
|
||||
#endif /* _BOARD_H_ */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _BOARD_H_
|
||||
#define _BOARD_H_
|
||||
|
||||
/*
|
||||
* Setup for a Generic STM32F103 board.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Board identifier.
|
||||
*/
|
||||
#define BOARD_GENERIC_STM32_F103
|
||||
#define BOARD_NAME "Generic STM32F103x board"
|
||||
|
||||
/*
|
||||
* Board frequencies.
|
||||
*/
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_HSECLK 8000000
|
||||
|
||||
/*
|
||||
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
|
||||
*/
|
||||
#define STM32F103xB
|
||||
|
||||
/*
|
||||
* IO pins assignments
|
||||
*/
|
||||
|
||||
/* on-board */
|
||||
|
||||
#define GPIOC_LED 13
|
||||
#define GPIOD_OSC_IN 0
|
||||
#define GPIOD_OSC_OUT 1
|
||||
|
||||
/* In case your board has a "USB enable" hardware
|
||||
controlled by a pin, define it here. (It could be just
|
||||
a 1.5k resistor connected to D+ line.)
|
||||
*/
|
||||
/*
|
||||
#define GPIOB_USB_DISC 10
|
||||
*/
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
*
|
||||
* The digits have the following meaning:
|
||||
* 0 - Analog input.
|
||||
* 1 - Push Pull output 10MHz.
|
||||
* 2 - Push Pull output 2MHz.
|
||||
* 3 - Push Pull output 50MHz.
|
||||
* 4 - Digital input.
|
||||
* 5 - Open Drain output 10MHz.
|
||||
* 6 - Open Drain output 2MHz.
|
||||
* 7 - Open Drain output 50MHz.
|
||||
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
|
||||
* 9 - Alternate Push Pull output 10MHz.
|
||||
* A - Alternate Push Pull output 2MHz.
|
||||
* B - Alternate Push Pull output 50MHz.
|
||||
* C - Reserved.
|
||||
* D - Alternate Open Drain output 10MHz.
|
||||
* E - Alternate Open Drain output 2MHz.
|
||||
* F - Alternate Open Drain output 50MHz.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Port A setup.
|
||||
* Everything input with pull-up except:
|
||||
* PA2 - Alternate output (USART2 TX).
|
||||
* PA3 - Normal input (USART2 RX).
|
||||
* PA9 - Alternate output (USART1 TX).
|
||||
* PA10 - Normal input (USART1 RX).
|
||||
*/
|
||||
#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */
|
||||
#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */
|
||||
#define VAL_GPIOAODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port B setup.
|
||||
* Everything input with pull-up except:
|
||||
* PB10 - Push Pull output (USB switch).
|
||||
*/
|
||||
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
|
||||
#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */
|
||||
#define VAL_GPIOBODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port C setup.
|
||||
* Everything input with pull-up except:
|
||||
* PC13 - Push Pull output (LED).
|
||||
*/
|
||||
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
|
||||
#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */
|
||||
#define VAL_GPIOCODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port D setup.
|
||||
* Everything input with pull-up except:
|
||||
* PD0 - Normal input (XTAL).
|
||||
* PD1 - Normal input (XTAL).
|
||||
*/
|
||||
#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
|
||||
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
|
||||
#define VAL_GPIODODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* Port E setup.
|
||||
* Everything input with pull-up except:
|
||||
*/
|
||||
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
|
||||
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
|
||||
#define VAL_GPIOEODR 0xFFFFFFFF
|
||||
|
||||
/*
|
||||
* USB bus activation macro, required by the USB driver.
|
||||
*/
|
||||
/* The point is that most of the generic STM32F103* boards
|
||||
have a 1.5k resistor connected on one end to the D+ line
|
||||
and on the other end to some pin. Or even a slightly more
|
||||
complicated "USB enable" circuit, controlled by a pin.
|
||||
That should go here.
|
||||
|
||||
However on some boards (e.g. one that I have), there's no
|
||||
such hardware. In which case it's better to not do anything.
|
||||
*/
|
||||
/*
|
||||
#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
|
||||
*/
|
||||
#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
|
||||
|
||||
/*
|
||||
* USB bus de-activation macro, required by the USB driver.
|
||||
*/
|
||||
/*
|
||||
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
|
||||
*/
|
||||
#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
|
||||
|
||||
#if !defined(_FROM_ASM_)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void boardInit(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _FROM_ASM_ */
|
||||
|
||||
#endif /* _BOARD_H_ */
|
||||
|
@ -1,5 +1,5 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103
|
||||
|
@ -1,105 +1,105 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com
|
||||
* (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* KL26Z64 memory setup.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x00000000, len = 0x100
|
||||
flash1 : org = 0x00000400, len = 0x10
|
||||
flash2 : org = 0x00000410, len = 62k - 0x410
|
||||
flash3 : org = 0x0000F800, len = 2k
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x1FFFF800, len = 8k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* Flash region for the configuration bytes.*/
|
||||
SECTIONS
|
||||
{
|
||||
.cfmprotect : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.cfmconfig))
|
||||
} > flash1
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash2);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash2);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash2);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash2);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash2);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
__eeprom_workarea_start__ = ORIGIN(flash3);
|
||||
__eeprom_workarea_size__ = LENGTH(flash3);
|
||||
__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
/*
|
||||
* Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com
|
||||
* (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* KL26Z64 memory setup.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x00000000, len = 0x100
|
||||
flash1 : org = 0x00000400, len = 0x10
|
||||
flash2 : org = 0x00000410, len = 62k - 0x410
|
||||
flash3 : org = 0x0000F800, len = 2k
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x1FFFF800, len = 8k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* Flash region for the configuration bytes.*/
|
||||
SECTIONS
|
||||
{
|
||||
.cfmprotect : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.cfmconfig))
|
||||
} > flash1
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash2);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash2);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash2);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash2);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash2);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
__eeprom_workarea_start__ = ORIGIN(flash3);
|
||||
__eeprom_workarea_size__ = LENGTH(flash3);
|
||||
__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
|
@ -1,88 +1,88 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ST32F103xB memory setup for use with the maplemini bootloader.
|
||||
* You will have to
|
||||
* #define CORTEX_VTOR_INIT 0x5000
|
||||
* in your projects chconf.h
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x08002000, len = 128k - 0x2000
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 20k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ST32F103xB memory setup for use with the maplemini bootloader.
|
||||
* You will have to
|
||||
* #define CORTEX_VTOR_INIT 0x5000
|
||||
* in your projects chconf.h
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x08002000, len = 128k - 0x2000
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 20k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
|
@ -0,0 +1,8 @@
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
@ -1,41 +1,3 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
MCU_FAMILY = STM32
|
||||
MCU_SERIES = STM32F0xx
|
||||
# linker script to use
|
||||
# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
MCU_LDSCRIPT = STM32F072xB
|
||||
# startup code to use
|
||||
# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
MCU_STARTUP = stm32f0xx
|
||||
# it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
BOARD = ST_STM32F072B_DISCOVERY
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m0
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
ARMV = 6
|
||||
# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
|
||||
# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
|
||||
# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
|
||||
# a custom board definition that you plan to reuse).
|
||||
# If you're not setting it here, leave it commented out.
|
||||
# It is chip dependent, the correct number can be looked up here (page 175):
|
||||
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
# This also requires a patch to chibios:
|
||||
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
@ -1,171 +1,171 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
/*
|
||||
* STM32F0xx drivers configuration.
|
||||
* The following settings override the default settings present in
|
||||
* the various device driver implementation headers.
|
||||
* Note that the settings for each driver only have effect if the whole
|
||||
* driver is enabled in halconf.h.
|
||||
*
|
||||
* IRQ priorities:
|
||||
* 3...0 Lowest...Highest.
|
||||
*
|
||||
* DMA priorities:
|
||||
* 0...3 Lowest...Highest.
|
||||
*/
|
||||
|
||||
#define STM32F0xx_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#define STM32_NO_INIT FALSE
|
||||
#define STM32_PVD_ENABLE FALSE
|
||||
#define STM32_PLS STM32_PLS_LEV0
|
||||
#define STM32_HSI_ENABLED TRUE
|
||||
#define STM32_HSI14_ENABLED TRUE
|
||||
#define STM32_HSI48_ENABLED FALSE
|
||||
#define STM32_LSI_ENABLED TRUE
|
||||
#define STM32_HSE_ENABLED FALSE
|
||||
#define STM32_LSE_ENABLED FALSE
|
||||
#define STM32_SW STM32_SW_PLL
|
||||
#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2
|
||||
#define STM32_PREDIV_VALUE 1
|
||||
#define STM32_PLLMUL_VALUE 12
|
||||
#define STM32_HPRE STM32_HPRE_DIV1
|
||||
#define STM32_PPRE STM32_PPRE_DIV1
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_USBSW STM32_USBSW_HSI48
|
||||
#define STM32_CECSW STM32_CECSW_HSI
|
||||
#define STM32_I2C1SW STM32_I2C1SW_HSI
|
||||
#define STM32_USART1SW STM32_USART1SW_PCLK
|
||||
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
||||
|
||||
/*
|
||||
* ADC driver system settings.
|
||||
*/
|
||||
#define STM32_ADC_USE_ADC1 FALSE
|
||||
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||
#define STM32_ADC_IRQ_PRIORITY 2
|
||||
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* EXT driver system settings.
|
||||
*/
|
||||
#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI16_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI17_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* GPT driver system settings.
|
||||
*/
|
||||
#define STM32_GPT_USE_TIM1 FALSE
|
||||
#define STM32_GPT_USE_TIM2 FALSE
|
||||
#define STM32_GPT_USE_TIM3 FALSE
|
||||
#define STM32_GPT_USE_TIM14 FALSE
|
||||
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM3_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM14_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* I2C driver system settings.
|
||||
*/
|
||||
#define STM32_I2C_USE_I2C1 FALSE
|
||||
#define STM32_I2C_USE_I2C2 FALSE
|
||||
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||
#define STM32_I2C_I2C1_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_I2C2_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_USE_DMA TRUE
|
||||
#define STM32_I2C_I2C1_DMA_PRIORITY 1
|
||||
#define STM32_I2C_I2C2_DMA_PRIORITY 1
|
||||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ICU driver system settings.
|
||||
*/
|
||||
#define STM32_ICU_USE_TIM1 FALSE
|
||||
#define STM32_ICU_USE_TIM2 FALSE
|
||||
#define STM32_ICU_USE_TIM3 FALSE
|
||||
#define STM32_ICU_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* PWM driver system settings.
|
||||
*/
|
||||
#define STM32_PWM_USE_ADVANCED FALSE
|
||||
#define STM32_PWM_USE_TIM1 FALSE
|
||||
#define STM32_PWM_USE_TIM2 FALSE
|
||||
#define STM32_PWM_USE_TIM3 FALSE
|
||||
#define STM32_PWM_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define STM32_SERIAL_USE_USART1 FALSE
|
||||
#define STM32_SERIAL_USE_USART2 FALSE
|
||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
#define STM32_SPI_USE_SPI1 FALSE
|
||||
#define STM32_SPI_USE_SPI2 FALSE
|
||||
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI1_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_SPI2_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ST driver system settings.
|
||||
*/
|
||||
#define STM32_ST_IRQ_PRIORITY 2
|
||||
#define STM32_ST_USE_TIMER 2
|
||||
|
||||
/*
|
||||
* UART driver system settings.
|
||||
*/
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
#define STM32_UART_USART1_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART2_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* USB driver system settings.
|
||||
*/
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
/*
|
||||
* STM32F0xx drivers configuration.
|
||||
* The following settings override the default settings present in
|
||||
* the various device driver implementation headers.
|
||||
* Note that the settings for each driver only have effect if the whole
|
||||
* driver is enabled in halconf.h.
|
||||
*
|
||||
* IRQ priorities:
|
||||
* 3...0 Lowest...Highest.
|
||||
*
|
||||
* DMA priorities:
|
||||
* 0...3 Lowest...Highest.
|
||||
*/
|
||||
|
||||
#define STM32F0xx_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#define STM32_NO_INIT FALSE
|
||||
#define STM32_PVD_ENABLE FALSE
|
||||
#define STM32_PLS STM32_PLS_LEV0
|
||||
#define STM32_HSI_ENABLED TRUE
|
||||
#define STM32_HSI14_ENABLED TRUE
|
||||
#define STM32_HSI48_ENABLED FALSE
|
||||
#define STM32_LSI_ENABLED TRUE
|
||||
#define STM32_HSE_ENABLED FALSE
|
||||
#define STM32_LSE_ENABLED FALSE
|
||||
#define STM32_SW STM32_SW_PLL
|
||||
#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2
|
||||
#define STM32_PREDIV_VALUE 1
|
||||
#define STM32_PLLMUL_VALUE 12
|
||||
#define STM32_HPRE STM32_HPRE_DIV1
|
||||
#define STM32_PPRE STM32_PPRE_DIV1
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_USBSW STM32_USBSW_HSI48
|
||||
#define STM32_CECSW STM32_CECSW_HSI
|
||||
#define STM32_I2C1SW STM32_I2C1SW_HSI
|
||||
#define STM32_USART1SW STM32_USART1SW_PCLK
|
||||
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
||||
|
||||
/*
|
||||
* ADC driver system settings.
|
||||
*/
|
||||
#define STM32_ADC_USE_ADC1 FALSE
|
||||
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||
#define STM32_ADC_IRQ_PRIORITY 2
|
||||
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* EXT driver system settings.
|
||||
*/
|
||||
#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI16_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI17_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* GPT driver system settings.
|
||||
*/
|
||||
#define STM32_GPT_USE_TIM1 FALSE
|
||||
#define STM32_GPT_USE_TIM2 FALSE
|
||||
#define STM32_GPT_USE_TIM3 FALSE
|
||||
#define STM32_GPT_USE_TIM14 FALSE
|
||||
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM3_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM14_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* I2C driver system settings.
|
||||
*/
|
||||
#define STM32_I2C_USE_I2C1 FALSE
|
||||
#define STM32_I2C_USE_I2C2 FALSE
|
||||
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||
#define STM32_I2C_I2C1_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_I2C2_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_USE_DMA TRUE
|
||||
#define STM32_I2C_I2C1_DMA_PRIORITY 1
|
||||
#define STM32_I2C_I2C2_DMA_PRIORITY 1
|
||||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ICU driver system settings.
|
||||
*/
|
||||
#define STM32_ICU_USE_TIM1 FALSE
|
||||
#define STM32_ICU_USE_TIM2 FALSE
|
||||
#define STM32_ICU_USE_TIM3 FALSE
|
||||
#define STM32_ICU_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* PWM driver system settings.
|
||||
*/
|
||||
#define STM32_PWM_USE_ADVANCED FALSE
|
||||
#define STM32_PWM_USE_TIM1 FALSE
|
||||
#define STM32_PWM_USE_TIM2 FALSE
|
||||
#define STM32_PWM_USE_TIM3 FALSE
|
||||
#define STM32_PWM_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define STM32_SERIAL_USE_USART1 FALSE
|
||||
#define STM32_SERIAL_USE_USART2 FALSE
|
||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
#define STM32_SPI_USE_SPI1 FALSE
|
||||
#define STM32_SPI_USE_SPI2 FALSE
|
||||
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI1_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_SPI2_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ST driver system settings.
|
||||
*/
|
||||
#define STM32_ST_IRQ_PRIORITY 2
|
||||
#define STM32_ST_USE_TIMER 2
|
||||
|
||||
/*
|
||||
* UART driver system settings.
|
||||
*/
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
#define STM32_UART_USART1_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART2_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* USB driver system settings.
|
||||
*/
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
|
@ -0,0 +1,41 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
MCU_FAMILY = STM32
|
||||
MCU_SERIES = STM32F0xx
|
||||
# linker script to use
|
||||
# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
MCU_LDSCRIPT = STM32F072xB
|
||||
# startup code to use
|
||||
# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
MCU_STARTUP = stm32f0xx
|
||||
# it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
BOARD = ST_STM32F072B_DISCOVERY
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m0
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
ARMV = 6
|
||||
# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
|
||||
# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
|
||||
# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
|
||||
# a custom board definition that you plan to reuse).
|
||||
# If you're not setting it here, leave it commented out.
|
||||
# It is chip dependent, the correct number can be looked up here (page 175):
|
||||
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
# This also requires a patch to chibios:
|
||||
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,52 +1,3 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
# GENERIC STM32F103C8T6 board - stm32duino bootloader
|
||||
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
|
||||
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
|
||||
BOARD = GENERIC_STM32_F103
|
||||
|
||||
# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
|
||||
# OPT_DEFS =
|
||||
# MCU_LDSCRIPT = STM32F103x8
|
||||
# BOARD = GENERIC_STM32_F103
|
||||
|
||||
# MAPLE MINI
|
||||
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
|
||||
# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
|
||||
# BOARD = MAPLEMINI_STM32_F103
|
||||
|
||||
## chip/board settings
|
||||
# the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
MCU_FAMILY = STM32
|
||||
MCU_SERIES = STM32F1xx
|
||||
# linker script to use
|
||||
# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# startup code to use
|
||||
# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
MCU_STARTUP = stm32f1xx
|
||||
# it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m3
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
ARMV = 7
|
||||
# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
|
||||
# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
|
||||
# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
|
||||
# a custom board definition that you plan to reuse).
|
||||
# If you're not setting it here, leave it commented out.
|
||||
# It is chip dependent, the correct number can be looked up here (page 175):
|
||||
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
# This also requires a patch to chibios:
|
||||
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
@ -1,209 +1,209 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define STM32F103_MCUCONF
|
||||
|
||||
/*
|
||||
* STM32F103 drivers configuration.
|
||||
* The following settings override the default settings present in
|
||||
* the various device driver implementation headers.
|
||||
* Note that the settings for each driver only have effect if the whole
|
||||
* driver is enabled in halconf.h.
|
||||
*
|
||||
* IRQ priorities:
|
||||
* 15...0 Lowest...Highest.
|
||||
*
|
||||
* DMA priorities:
|
||||
* 0...3 Lowest...Highest.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#define STM32_NO_INIT FALSE
|
||||
#define STM32_HSI_ENABLED TRUE
|
||||
#define STM32_LSI_ENABLED FALSE
|
||||
#define STM32_HSE_ENABLED TRUE
|
||||
#define STM32_LSE_ENABLED FALSE
|
||||
#define STM32_SW STM32_SW_PLL
|
||||
#define STM32_PLLSRC STM32_PLLSRC_HSE
|
||||
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
|
||||
#define STM32_PLLMUL_VALUE 9
|
||||
#define STM32_HPRE STM32_HPRE_DIV1
|
||||
#define STM32_PPRE1 STM32_PPRE1_DIV2
|
||||
#define STM32_PPRE2 STM32_PPRE2_DIV2
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_USB_CLOCK_REQUIRED TRUE
|
||||
#define STM32_USBPRE STM32_USBPRE_DIV1P5
|
||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||
#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
|
||||
#define STM32_PVD_ENABLE FALSE
|
||||
#define STM32_PLS STM32_PLS_LEV0
|
||||
|
||||
/*
|
||||
* ADC driver system settings.
|
||||
*/
|
||||
#define STM32_ADC_USE_ADC1 FALSE
|
||||
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||
#define STM32_ADC_ADC1_IRQ_PRIORITY 6
|
||||
|
||||
/*
|
||||
* CAN driver system settings.
|
||||
*/
|
||||
#define STM32_CAN_USE_CAN1 FALSE
|
||||
#define STM32_CAN_CAN1_IRQ_PRIORITY 11
|
||||
|
||||
/*
|
||||
* EXT driver system settings.
|
||||
*/
|
||||
#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
|
||||
|
||||
/*
|
||||
* GPT driver system settings.
|
||||
*/
|
||||
#define STM32_GPT_USE_TIM1 FALSE
|
||||
#define STM32_GPT_USE_TIM2 FALSE
|
||||
#define STM32_GPT_USE_TIM3 FALSE
|
||||
#define STM32_GPT_USE_TIM4 FALSE
|
||||
#define STM32_GPT_USE_TIM5 FALSE
|
||||
#define STM32_GPT_USE_TIM8 FALSE
|
||||
#define STM32_GPT_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* I2C driver system settings.
|
||||
*/
|
||||
#define STM32_I2C_USE_I2C1 FALSE
|
||||
#define STM32_I2C_USE_I2C2 FALSE
|
||||
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||
#define STM32_I2C_I2C1_IRQ_PRIORITY 5
|
||||
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
|
||||
#define STM32_I2C_I2C1_DMA_PRIORITY 3
|
||||
#define STM32_I2C_I2C2_DMA_PRIORITY 3
|
||||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ICU driver system settings.
|
||||
*/
|
||||
#define STM32_ICU_USE_TIM1 FALSE
|
||||
#define STM32_ICU_USE_TIM2 FALSE
|
||||
#define STM32_ICU_USE_TIM3 FALSE
|
||||
#define STM32_ICU_USE_TIM4 FALSE
|
||||
#define STM32_ICU_USE_TIM5 FALSE
|
||||
#define STM32_ICU_USE_TIM8 FALSE
|
||||
#define STM32_ICU_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* PWM driver system settings.
|
||||
*/
|
||||
#define STM32_PWM_USE_ADVANCED FALSE
|
||||
#define STM32_PWM_USE_TIM1 FALSE
|
||||
#define STM32_PWM_USE_TIM2 FALSE
|
||||
#define STM32_PWM_USE_TIM3 FALSE
|
||||
#define STM32_PWM_USE_TIM4 FALSE
|
||||
#define STM32_PWM_USE_TIM5 FALSE
|
||||
#define STM32_PWM_USE_TIM8 FALSE
|
||||
#define STM32_PWM_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* RTC driver system settings.
|
||||
*/
|
||||
#define STM32_RTC_IRQ_PRIORITY 15
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define STM32_SERIAL_USE_USART1 FALSE
|
||||
#define STM32_SERIAL_USE_USART2 FALSE
|
||||
#define STM32_SERIAL_USE_USART3 FALSE
|
||||
#define STM32_SERIAL_USE_UART4 FALSE
|
||||
#define STM32_SERIAL_USE_UART5 FALSE
|
||||
#define STM32_SERIAL_USART1_PRIORITY 12
|
||||
#define STM32_SERIAL_USART2_PRIORITY 12
|
||||
#define STM32_SERIAL_USART3_PRIORITY 12
|
||||
#define STM32_SERIAL_UART4_PRIORITY 12
|
||||
#define STM32_SERIAL_UART5_PRIORITY 12
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
#define STM32_SPI_USE_SPI1 FALSE
|
||||
#define STM32_SPI_USE_SPI2 FALSE
|
||||
#define STM32_SPI_USE_SPI3 FALSE
|
||||
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI3_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ST driver system settings.
|
||||
*/
|
||||
#define STM32_ST_IRQ_PRIORITY 8
|
||||
#define STM32_ST_USE_TIMER 2
|
||||
|
||||
/*
|
||||
* UART driver system settings.
|
||||
*/
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
#define STM32_UART_USE_USART3 FALSE
|
||||
#define STM32_UART_USART1_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART2_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART3_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART3_DMA_PRIORITY 0
|
||||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* USB driver system settings.
|
||||
*/
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||
#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
|
||||
#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define STM32F103_MCUCONF
|
||||
|
||||
/*
|
||||
* STM32F103 drivers configuration.
|
||||
* The following settings override the default settings present in
|
||||
* the various device driver implementation headers.
|
||||
* Note that the settings for each driver only have effect if the whole
|
||||
* driver is enabled in halconf.h.
|
||||
*
|
||||
* IRQ priorities:
|
||||
* 15...0 Lowest...Highest.
|
||||
*
|
||||
* DMA priorities:
|
||||
* 0...3 Lowest...Highest.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#define STM32_NO_INIT FALSE
|
||||
#define STM32_HSI_ENABLED TRUE
|
||||
#define STM32_LSI_ENABLED FALSE
|
||||
#define STM32_HSE_ENABLED TRUE
|
||||
#define STM32_LSE_ENABLED FALSE
|
||||
#define STM32_SW STM32_SW_PLL
|
||||
#define STM32_PLLSRC STM32_PLLSRC_HSE
|
||||
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
|
||||
#define STM32_PLLMUL_VALUE 9
|
||||
#define STM32_HPRE STM32_HPRE_DIV1
|
||||
#define STM32_PPRE1 STM32_PPRE1_DIV2
|
||||
#define STM32_PPRE2 STM32_PPRE2_DIV2
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_USB_CLOCK_REQUIRED TRUE
|
||||
#define STM32_USBPRE STM32_USBPRE_DIV1P5
|
||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||
#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
|
||||
#define STM32_PVD_ENABLE FALSE
|
||||
#define STM32_PLS STM32_PLS_LEV0
|
||||
|
||||
/*
|
||||
* ADC driver system settings.
|
||||
*/
|
||||
#define STM32_ADC_USE_ADC1 FALSE
|
||||
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||
#define STM32_ADC_ADC1_IRQ_PRIORITY 6
|
||||
|
||||
/*
|
||||
* CAN driver system settings.
|
||||
*/
|
||||
#define STM32_CAN_USE_CAN1 FALSE
|
||||
#define STM32_CAN_CAN1_IRQ_PRIORITY 11
|
||||
|
||||
/*
|
||||
* EXT driver system settings.
|
||||
*/
|
||||
#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
|
||||
#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
|
||||
|
||||
/*
|
||||
* GPT driver system settings.
|
||||
*/
|
||||
#define STM32_GPT_USE_TIM1 FALSE
|
||||
#define STM32_GPT_USE_TIM2 FALSE
|
||||
#define STM32_GPT_USE_TIM3 FALSE
|
||||
#define STM32_GPT_USE_TIM4 FALSE
|
||||
#define STM32_GPT_USE_TIM5 FALSE
|
||||
#define STM32_GPT_USE_TIM8 FALSE
|
||||
#define STM32_GPT_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_GPT_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* I2C driver system settings.
|
||||
*/
|
||||
#define STM32_I2C_USE_I2C1 FALSE
|
||||
#define STM32_I2C_USE_I2C2 FALSE
|
||||
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||
#define STM32_I2C_I2C1_IRQ_PRIORITY 5
|
||||
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
|
||||
#define STM32_I2C_I2C1_DMA_PRIORITY 3
|
||||
#define STM32_I2C_I2C2_DMA_PRIORITY 3
|
||||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ICU driver system settings.
|
||||
*/
|
||||
#define STM32_ICU_USE_TIM1 FALSE
|
||||
#define STM32_ICU_USE_TIM2 FALSE
|
||||
#define STM32_ICU_USE_TIM3 FALSE
|
||||
#define STM32_ICU_USE_TIM4 FALSE
|
||||
#define STM32_ICU_USE_TIM5 FALSE
|
||||
#define STM32_ICU_USE_TIM8 FALSE
|
||||
#define STM32_ICU_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_ICU_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* PWM driver system settings.
|
||||
*/
|
||||
#define STM32_PWM_USE_ADVANCED FALSE
|
||||
#define STM32_PWM_USE_TIM1 FALSE
|
||||
#define STM32_PWM_USE_TIM2 FALSE
|
||||
#define STM32_PWM_USE_TIM3 FALSE
|
||||
#define STM32_PWM_USE_TIM4 FALSE
|
||||
#define STM32_PWM_USE_TIM5 FALSE
|
||||
#define STM32_PWM_USE_TIM8 FALSE
|
||||
#define STM32_PWM_TIM1_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM2_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM3_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM4_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM5_IRQ_PRIORITY 7
|
||||
#define STM32_PWM_TIM8_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* RTC driver system settings.
|
||||
*/
|
||||
#define STM32_RTC_IRQ_PRIORITY 15
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define STM32_SERIAL_USE_USART1 FALSE
|
||||
#define STM32_SERIAL_USE_USART2 FALSE
|
||||
#define STM32_SERIAL_USE_USART3 FALSE
|
||||
#define STM32_SERIAL_USE_UART4 FALSE
|
||||
#define STM32_SERIAL_USE_UART5 FALSE
|
||||
#define STM32_SERIAL_USART1_PRIORITY 12
|
||||
#define STM32_SERIAL_USART2_PRIORITY 12
|
||||
#define STM32_SERIAL_USART3_PRIORITY 12
|
||||
#define STM32_SERIAL_UART4_PRIORITY 12
|
||||
#define STM32_SERIAL_UART5_PRIORITY 12
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
#define STM32_SPI_USE_SPI1 FALSE
|
||||
#define STM32_SPI_USE_SPI2 FALSE
|
||||
#define STM32_SPI_USE_SPI3 FALSE
|
||||
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI3_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ST driver system settings.
|
||||
*/
|
||||
#define STM32_ST_IRQ_PRIORITY 8
|
||||
#define STM32_ST_USE_TIMER 2
|
||||
|
||||
/*
|
||||
* UART driver system settings.
|
||||
*/
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
#define STM32_UART_USE_USART3 FALSE
|
||||
#define STM32_UART_USART1_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART2_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART3_IRQ_PRIORITY 12
|
||||
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART3_DMA_PRIORITY 0
|
||||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* USB driver system settings.
|
||||
*/
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||
#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
|
||||
#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
|
@ -0,0 +1,52 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
# GENERIC STM32F103C8T6 board - stm32duino bootloader
|
||||
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
|
||||
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
|
||||
BOARD = GENERIC_STM32_F103
|
||||
|
||||
# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
|
||||
# OPT_DEFS =
|
||||
# MCU_LDSCRIPT = STM32F103x8
|
||||
# BOARD = GENERIC_STM32_F103
|
||||
|
||||
# MAPLE MINI
|
||||
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
|
||||
# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
|
||||
# BOARD = MAPLEMINI_STM32_F103
|
||||
|
||||
## chip/board settings
|
||||
# the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
MCU_FAMILY = STM32
|
||||
MCU_SERIES = STM32F1xx
|
||||
# linker script to use
|
||||
# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# startup code to use
|
||||
# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
MCU_STARTUP = stm32f1xx
|
||||
# it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m3
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
ARMV = 7
|
||||
# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
|
||||
# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
|
||||
# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
|
||||
# a custom board definition that you plan to reuse).
|
||||
# If you're not setting it here, leave it commented out.
|
||||
# It is chip dependent, the correct number can be looked up here (page 175):
|
||||
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
# This also requires a patch to chibios:
|
||||
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,49 +1,3 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = KL2x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
MCU_LDSCRIPT = MKL26Z64
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0
|
||||
# - k20x7 for Teensy 3.1 and 3.2
|
||||
MCU_STARTUP = kl2x
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
BOARD = PJRC_TEENSY_LC
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m0plus
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,524 +1,524 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 1000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 1000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS TRUE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
||||
|
@ -1,187 +1,187 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
||||
|
@ -1,55 +1,55 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define KL2x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#if 1
|
||||
/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
|
||||
#define KINETIS_PLLCLK_FREQUENCY 96000000UL
|
||||
#define KINETIS_SYSCLK_FREQUENCY 48000000UL
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
|
||||
#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
|
||||
#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
|
||||
#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
|
||||
#define KINETIS_CLKDIV1_OUTDIV1 1 /* do not divide system clock */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
/* Need to redefine this, since the default is for K20x */
|
||||
/* This is for Teensy LC; you should comment it out (or change to 5)
|
||||
* for Teensy 3.x */
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 2
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define KL2x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#if 1
|
||||
/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
|
||||
#define KINETIS_PLLCLK_FREQUENCY 96000000UL
|
||||
#define KINETIS_SYSCLK_FREQUENCY 48000000UL
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
|
||||
#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
|
||||
#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
|
||||
#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
|
||||
#define KINETIS_CLKDIV1_OUTDIV1 1 /* do not divide system clock */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
/* Need to redefine this, since the default is for K20x */
|
||||
/* This is for Teensy LC; you should comment it out (or change to 5)
|
||||
* for Teensy 3.x */
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 2
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
|
@ -0,0 +1,49 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = KL2x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
MCU_LDSCRIPT = MKL26Z64
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0
|
||||
# - k20x7 for Teensy 3.1 and 3.2
|
||||
MCU_STARTUP = kl2x
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
BOARD = PJRC_TEENSY_LC
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m0plus
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,109 +1,5 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBPROJECT_DEFAULT = rev2
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change to no to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
AUDIO_ENABLE ?= no
|
||||
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -1,5 +1,3 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,5 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,5 +1,3 @@
|
||||
BACKLIGHT_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,5 @@
|
||||
BACKLIGHT_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,103 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
AUDIO_ENABLE ?= no
|
||||
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,76 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
@ -1,70 +1,3 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality
|
||||
RGBLIGHT_ENABLE ?= yes
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,65 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
# MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
# EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable numpad's backlight functionality
|
||||
RGBLIGHT_ENABLE ?= yes
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,34 +1,5 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
SUBPROJECT_DEFAULT = ez
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= yes # Unicode
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -1,76 +1,3 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# # project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,76 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# # project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,77 +1,3 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
# - For Infinity KB, SERIES = K20x
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = K20x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
|
||||
# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
|
||||
MCU_LDSCRIPT = MK20DX256BLDR8
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0 and Infinity 60%
|
||||
# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
|
||||
MCU_STARTUP = k20x7
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
# - MCHCK_K20 for Infinity KB
|
||||
#BOARD = MCHCK_K20
|
||||
BOARD = PJRC_TEENSY_3_1
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m4
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 7
|
||||
|
||||
# Vector table for application
|
||||
# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
|
||||
# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
|
||||
OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
SERIAL_LINK_ENABLE = yes
|
||||
VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
|
||||
LCD_ENABLE ?= yes
|
||||
LED_ENABLE ?= yes
|
||||
LCD_BACKLIGHT_ENABLE ?= yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
ifdef LCD_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
|
||||
endif
|
||||
|
||||
ifdef LED_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
|
||||
endif
|
||||
endif
|
@ -0,0 +1,77 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
# - For Infinity KB, SERIES = K20x
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = K20x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
|
||||
# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
|
||||
MCU_LDSCRIPT = MK20DX256BLDR8
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0 and Infinity 60%
|
||||
# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
|
||||
MCU_STARTUP = k20x7
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
# - MCHCK_K20 for Infinity KB
|
||||
#BOARD = MCHCK_K20
|
||||
BOARD = PJRC_TEENSY_3_1
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m4
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 7
|
||||
|
||||
# Vector table for application
|
||||
# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
|
||||
# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
|
||||
OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
SERIAL_LINK_ENABLE = yes
|
||||
VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
|
||||
LCD_ENABLE ?= yes
|
||||
LED_ENABLE ?= yes
|
||||
LCD_BACKLIGHT_ENABLE ?= yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
ifdef LCD_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
|
||||
endif
|
||||
|
||||
ifdef LED_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
|
||||
endif
|
@ -0,0 +1,28 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= yes # Unicode
|
@ -1,74 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
@ -1,161 +1,161 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||
// Rev A
|
||||
// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
|
||||
// Rev B/C
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||
// Rev A
|
||||
// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
|
||||
// Rev B/C
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
||||
|
@ -1,25 +1,25 @@
|
||||
#include "gh60.h"
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
gh60_caps_led_on();
|
||||
} else {
|
||||
gh60_caps_led_off();
|
||||
}
|
||||
|
||||
// if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// gh60_esc_led_on();
|
||||
// } else {
|
||||
// gh60_esc_led_off();
|
||||
// }
|
||||
|
||||
// if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
// gh60_fn_led_on();
|
||||
// } else {
|
||||
// gh60_fn_led_off();
|
||||
// }
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
#include "gh60.h"
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
gh60_caps_led_on();
|
||||
} else {
|
||||
gh60_caps_led_off();
|
||||
}
|
||||
|
||||
// if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// gh60_esc_led_on();
|
||||
// } else {
|
||||
// gh60_esc_led_off();
|
||||
// }
|
||||
|
||||
// if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
// gh60_fn_led_on();
|
||||
// } else {
|
||||
// gh60_fn_led_off();
|
||||
// }
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
|
@ -1,74 +1,74 @@
|
||||
#ifndef GH60_H
|
||||
#define GH60_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "led.h"
|
||||
|
||||
/* GH60 LEDs
|
||||
* GPIO pads
|
||||
* 0 F7 WASD LEDs
|
||||
* 1 F6 ESC LED
|
||||
* 2 F5 FN LED
|
||||
* 3 F4 POKER Arrow LEDs
|
||||
* B2 Capslock LED
|
||||
* B0 not connected
|
||||
*/
|
||||
inline void gh60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||
inline void gh60_poker_leds_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
|
||||
inline void gh60_fn_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
|
||||
inline void gh60_esc_led_on(void) { DDRF |= (1<<6); PORTF &= ~(1<<6); }
|
||||
inline void gh60_wasd_leds_on(void) { DDRF |= (1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
inline void gh60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||
inline void gh60_poker_leds_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
|
||||
inline void gh60_fn_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
|
||||
inline void gh60_esc_led_off(void) { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }
|
||||
inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
/* GH60 keymap definition macro
|
||||
* K2C, K31 and K3C are extra keys for ISO
|
||||
*/
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
|
||||
K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
|
||||
{ KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \
|
||||
}
|
||||
|
||||
/* ANSI valiant. No extra keys for ISO */
|
||||
#define KEYMAP_ANSI( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
|
||||
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
||||
) KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \
|
||||
K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \
|
||||
K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \
|
||||
)
|
||||
|
||||
#define KEYMAP_HHKB( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \
|
||||
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
||||
) KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \
|
||||
K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
|
||||
K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \
|
||||
)
|
||||
|
||||
#endif
|
||||
#ifndef GH60_H
|
||||
#define GH60_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "led.h"
|
||||
|
||||
/* GH60 LEDs
|
||||
* GPIO pads
|
||||
* 0 F7 WASD LEDs
|
||||
* 1 F6 ESC LED
|
||||
* 2 F5 FN LED
|
||||
* 3 F4 POKER Arrow LEDs
|
||||
* B2 Capslock LED
|
||||
* B0 not connected
|
||||
*/
|
||||
inline void gh60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||
inline void gh60_poker_leds_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
|
||||
inline void gh60_fn_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
|
||||
inline void gh60_esc_led_on(void) { DDRF |= (1<<6); PORTF &= ~(1<<6); }
|
||||
inline void gh60_wasd_leds_on(void) { DDRF |= (1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
inline void gh60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||
inline void gh60_poker_leds_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
|
||||
inline void gh60_fn_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
|
||||
inline void gh60_esc_led_off(void) { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }
|
||||
inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
|
||||
|
||||
/* GH60 keymap definition macro
|
||||
* K2C, K31 and K3C are extra keys for ISO
|
||||
*/
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
|
||||
K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
|
||||
{ KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \
|
||||
}
|
||||
|
||||
/* ANSI valiant. No extra keys for ISO */
|
||||
#define KEYMAP_ANSI( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
|
||||
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
||||
) KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \
|
||||
K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \
|
||||
K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \
|
||||
)
|
||||
|
||||
#define KEYMAP_HHKB( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \
|
||||
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
||||
) KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \
|
||||
K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
|
||||
K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \
|
||||
)
|
||||
|
||||
#endif
|
||||
|
@ -1,112 +1,112 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
|
@ -1,190 +1,190 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||
// Rev A
|
||||
// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
|
||||
// Rev B/C
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* RGB Underglow
|
||||
* These settings are for the F4 by default:
|
||||
*
|
||||
*
|
||||
* #define ws2812_PORTREG PORTF
|
||||
* #define ws2812_DDRREG DDRF
|
||||
* #define ws2812_pin PF4
|
||||
* #define RGBLED_NUM 14 // Number of LEDs
|
||||
* #define RGBLIGHT_HUE_STEP 10
|
||||
* #define RGBLIGHT_SAT_STEP 17
|
||||
* #define RGBLIGHT_VAL_STEP 17
|
||||
*
|
||||
* The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects.
|
||||
* To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations.
|
||||
* For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c
|
||||
*/
|
||||
|
||||
/* Deprecated code below
|
||||
#define ws2812_PORTREG PORTF
|
||||
#define ws2812_DDRREG DDRF
|
||||
#define ws2812_pin PF4
|
||||
*/
|
||||
#define RGB_DI_PIN F4
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 8 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||
// Rev A
|
||||
// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
|
||||
// Rev B/C
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* RGB Underglow
|
||||
* These settings are for the F4 by default:
|
||||
*
|
||||
*
|
||||
* #define ws2812_PORTREG PORTF
|
||||
* #define ws2812_DDRREG DDRF
|
||||
* #define ws2812_pin PF4
|
||||
* #define RGBLED_NUM 14 // Number of LEDs
|
||||
* #define RGBLIGHT_HUE_STEP 10
|
||||
* #define RGBLIGHT_SAT_STEP 17
|
||||
* #define RGBLIGHT_VAL_STEP 17
|
||||
*
|
||||
* The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects.
|
||||
* To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations.
|
||||
* For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c
|
||||
*/
|
||||
|
||||
/* Deprecated code below
|
||||
#define ws2812_PORTREG PORTF
|
||||
#define ws2812_DDRREG DDRF
|
||||
#define ws2812_pin PF4
|
||||
*/
|
||||
#define RGB_DI_PIN F4
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 8 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
||||
|
@ -1,18 +1,18 @@
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
* pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C)
|
||||
*/
|
||||
|
||||
/* Row pin configuration
|
||||
* row: 0 1 2 3 4
|
||||
* pin: D0 D1 D2 D3 D5
|
||||
*/
|
||||
|
||||
GPIO pads
|
||||
0 F7 WASD LEDs
|
||||
1 F6 ESC LED
|
||||
2 F5 FN LED
|
||||
3 F4 POKER Arrow LEDs
|
||||
|
||||
B2 Capslock LED
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
* pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C)
|
||||
*/
|
||||
|
||||
/* Row pin configuration
|
||||
* row: 0 1 2 3 4
|
||||
* pin: D0 D1 D2 D3 D5
|
||||
*/
|
||||
|
||||
GPIO pads
|
||||
0 F7 WASD LEDs
|
||||
1 F6 ESC LED
|
||||
2 F5 FN LED
|
||||
3 F4 POKER Arrow LEDs
|
||||
|
||||
B2 Capslock LED
|
||||
B0 not connected
|
@ -1,60 +1,62 @@
|
||||
## gh60 Rev C keyboard firmware
|
||||
|
||||
![gh60 Rev C PCB](gh60revc.jpg)
|
||||
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
* pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C)
|
||||
*/
|
||||
|
||||
/* Row pin configuration
|
||||
* row: 0 1 2 3 4
|
||||
* pin: D0 D1 D2 D3 D5
|
||||
*/
|
||||
|
||||
GPIO pads
|
||||
0 F7 WASD LEDs
|
||||
1 F6 ESC LED
|
||||
2 F5 FN LED
|
||||
3 F4 POKER Arrow LEDs
|
||||
|
||||
B2 Capslock LED
|
||||
B0 not connected
|
||||
|
||||
Functions to controls LED clusters
|
||||
|
||||
gh60_caps_led_on()
|
||||
gh60_poker_leds_on()
|
||||
gh60_fn_led_on()
|
||||
gh60_esc_led_on()
|
||||
gh60_wasd_leds_on()
|
||||
|
||||
gh60_caps_led_off()
|
||||
gh60_poker_leds_off()
|
||||
gh60_fn_led_off()
|
||||
gh60_esc_led_off()
|
||||
gh60_wasd_leds_off()
|
||||
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
To build with the default keymap, simply run `make`.
|
||||
|
||||
### Other Keymaps
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
|
||||
```
|
||||
$ make KEYMAP=[default|jack|<name>]
|
||||
```
|
||||
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
||||
## gh60 Rev C keyboard firmware
|
||||
|
||||
![gh60 Rev C PCB](gh60revc.jpg)
|
||||
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
* pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C)
|
||||
*/
|
||||
|
||||
/* Row pin configuration
|
||||
* row: 0 1 2 3 4
|
||||
* pin: D0 D1 D2 D3 D5
|
||||
*/
|
||||
|
||||
GPIO pads
|
||||
0 F7 WASD LEDs
|
||||
1 F6 ESC LED
|
||||
2 F5 FN LED
|
||||
3 F4 POKER Arrow LEDs
|
||||
|
||||
B2 Capslock LED
|
||||
B0 not connected
|
||||
|
||||
Functions to controls LED clusters
|
||||
|
||||
gh60_caps_led_on()
|
||||
gh60_poker_leds_on()
|
||||
gh60_fn_led_on()
|
||||
gh60_esc_led_on()
|
||||
gh60_wasd_leds_on()
|
||||
|
||||
gh60_caps_led_off()
|
||||
gh60_poker_leds_off()
|
||||
gh60_fn_led_off()
|
||||
gh60_esc_led_off()
|
||||
gh60_wasd_leds_off()
|
||||
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
To build with the default keymap, simply run `make default`.
|
||||
|
||||
### Other Keymaps
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||
|
||||
```
|
||||
$ make [default|jack|<name>]
|
||||
```
|
||||
|
||||
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
||||
|
@ -0,0 +1,66 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,73 +1,3 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,73 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -1,73 +1,3 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,73 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
|
@ -1,71 +1,3 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,67 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
@ -1,65 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,65 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,89 +1,3 @@
|
||||
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
# for avr upload
|
||||
USB ?= /dev/cu.usbmodem1421
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
|
||||
ifdef TEENSY2
|
||||
OPT_DEFS += -DATREUS_TEENSY2
|
||||
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||
else
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
endif
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# MCU name
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
RGBLIGHT_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
upload: build
|
||||
$(ATREUS_UPLOAD_COMMAND)
|
||||
|
||||
endif
|
@ -0,0 +1,89 @@
|
||||
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
# for avr upload
|
||||
USB ?= /dev/cu.usbmodem1421
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
|
||||
ifdef TEENSY2
|
||||
OPT_DEFS += -DATREUS_TEENSY2
|
||||
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||
else
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
endif
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# MCU name
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
RGBLIGHT_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
upload: build
|
||||
$(ATREUS_UPLOAD_COMMAND)
|
||||
|
@ -1,90 +1,3 @@
|
||||
|
||||
|
||||
# project specific files
|
||||
SRC = matrix.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
#OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# as per original hasu settings
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
ifneq (, $(findstring yes, $(HHKB_JP)))
|
||||
OPT_DEFS += -DHHKB_JP
|
||||
endif
|
||||
|
||||
debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION
|
||||
debug-on: all
|
||||
|
||||
debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT
|
||||
debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS))
|
||||
debug-off: all
|
||||
endif
|
@ -0,0 +1,84 @@
|
||||
|
||||
|
||||
# project specific files
|
||||
SRC = matrix.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
#OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# as per original hasu settings
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file for the HHKB
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifneq (, $(findstring yes, $(HHKB_JP)))
|
||||
OPT_DEFS += -DHHKB_JP
|
||||
endif
|
||||
|
||||
debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION
|
||||
debug-on: all
|
||||
|
||||
debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT
|
||||
debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS))
|
||||
debug-off: all
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -1,524 +1,524 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 1000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 1000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
@ -1,353 +1,353 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ADC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* CAN driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* I2C driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables the mutual exclusion APIs on the I2C bus.
|
||||
*/
|
||||
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define I2C_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MAC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_ZERO_COPY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MMC_SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
* This option is recommended also if the SPI driver does not
|
||||
* use a DMA channel and heavily loads the CPU.
|
||||
*/
|
||||
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define MMC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SDC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Number of initialization attempts before rejecting the card.
|
||||
* @note Attempts are performed at 10mS intervals.
|
||||
*/
|
||||
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
|
||||
#define SDC_INIT_RETRY 100
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Include support for MMC cards.
|
||||
* @note MMC support is not yet implemented so this option must be kept
|
||||
* at @p FALSE.
|
||||
*/
|
||||
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
|
||||
#define SDC_MMC_SUPPORT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
*/
|
||||
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define SDC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Default bit rate.
|
||||
* @details Configuration parameter, this is the baud rate selected for the
|
||||
* default configuration.
|
||||
*/
|
||||
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_DEFAULT_BITRATE 38400
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Serial buffers size.
|
||||
* @details Configuration parameter, you can change the depth of the queue
|
||||
* buffers depending on the requirements of your application.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_BUFFERS_SIZE 16
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL_USB driver related setting. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Serial over USB buffers size.
|
||||
* @details Configuration parameter, the buffer size must be a multiple of
|
||||
* the USB data endpoint maximum packet size.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ADC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* CAN driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* I2C driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables the mutual exclusion APIs on the I2C bus.
|
||||
*/
|
||||
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define I2C_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MAC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_ZERO_COPY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MMC_SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
* This option is recommended also if the SPI driver does not
|
||||
* use a DMA channel and heavily loads the CPU.
|
||||
*/
|
||||
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define MMC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SDC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Number of initialization attempts before rejecting the card.
|
||||
* @note Attempts are performed at 10mS intervals.
|
||||
*/
|
||||
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
|
||||
#define SDC_INIT_RETRY 100
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Include support for MMC cards.
|
||||
* @note MMC support is not yet implemented so this option must be kept
|
||||
* at @p FALSE.
|
||||
*/
|
||||
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
|
||||
#define SDC_MMC_SUPPORT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
*/
|
||||
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define SDC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Default bit rate.
|
||||
* @details Configuration parameter, this is the baud rate selected for the
|
||||
* default configuration.
|
||||
*/
|
||||
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_DEFAULT_BITRATE 38400
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Serial buffers size.
|
||||
* @details Configuration parameter, you can change the depth of the queue
|
||||
* buffers depending on the requirements of your application.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_BUFFERS_SIZE 16
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL_USB driver related setting. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Serial over USB buffers size.
|
||||
* @details Configuration parameter, the buffer size must be a multiple of
|
||||
* the USB data endpoint maximum packet size.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
@ -1,4 +1,4 @@
|
||||
#include "infinity_chibios.h"
|
||||
#include "infinity60.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
@ -1,4 +1,4 @@
|
||||
#include "infinity_chibios.h"
|
||||
#include "infinity60.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
@ -1,4 +1,4 @@
|
||||
#include "infinity_chibios.h"
|
||||
#include "infinity60.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
@ -1,55 +1,55 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define K20x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
|
||||
/* Select the MCU clocking mode below by enabling the appropriate block. */
|
||||
|
||||
#define KINETIS_NO_INIT FALSE
|
||||
|
||||
/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
|
||||
#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
|
||||
#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
|
||||
#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
|
||||
#define KINETIS_CLKDIV1_OUTDIV1 1
|
||||
#define KINETIS_CLKDIV1_OUTDIV2 1
|
||||
#define KINETIS_CLKDIV1_OUTDIV4 2
|
||||
#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
|
||||
#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
/* Need to redefine this, since the default is for K20x */
|
||||
/* This is for Teensy LC; you should comment it out (or change to 5)
|
||||
* for Teensy 3.x */
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 2
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define K20x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
|
||||
/* Select the MCU clocking mode below by enabling the appropriate block. */
|
||||
|
||||
#define KINETIS_NO_INIT FALSE
|
||||
|
||||
/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
|
||||
#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
|
||||
#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
|
||||
#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
|
||||
#define KINETIS_CLKDIV1_OUTDIV1 1
|
||||
#define KINETIS_CLKDIV1_OUTDIV2 1
|
||||
#define KINETIS_CLKDIV1_OUTDIV4 2
|
||||
#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
|
||||
#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
/* Need to redefine this, since the default is for K20x */
|
||||
/* This is for Teensy LC; you should comment it out (or change to 5)
|
||||
* for Teensy 3.x */
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 2
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
@ -0,0 +1,29 @@
|
||||
Infinity 60% keyboard firmware
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme](/).
|
||||
|
||||
## Keymaps
|
||||
|
||||
Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
||||
|
||||
|
||||
## Compiling
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/infinity60 folder. Once your dev env is setup, you'll be able to use the `make` command to both compile your keymap and flash it to your keyboard.
|
||||
|
||||
To just compile, which generates the output files in the `.build` folder at the root of the repository, run `make keymap`, where keymap is the name of the keymap that you want to compile.
|
||||
|
||||
## Flashing
|
||||
|
||||
To flash the firmware to the keyboard
|
||||
|
||||
1. First press the flash button on the bottom of the keyboard. If you already have a flah button mapped in a keyboard layout running on the keyboard, you can also use that.
|
||||
2. Then run `make keymap-dfu-util`, where keymap is the name of the keymap you want to flash. On Linux based operating systems you might need to run the comamnd as root, for example `sudo make keymap-dfu-util` on Ubuntu.
|
||||
|
||||
**Tip** `make keymap-dfu-util` will also compile the keymap if needed, so you can skip the compilation step if you want to.
|
||||
|
@ -1,71 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,67 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
# NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -0,0 +1,71 @@
|
||||
# project specific files
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -1,79 +1,3 @@
|
||||
|
||||
## Project specific files
|
||||
|
||||
SRC= matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = at90usb1286
|
||||
#MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming
|
||||
CUSTOM_MATRIX=yes # need to do our own thing with the matrix
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,73 @@
|
||||
|
||||
## Project specific files
|
||||
|
||||
SRC= matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = at90usb1286
|
||||
#MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming
|
||||
CUSTOM_MATRIX=yes # need to do our own thing with the matrix
|
@ -0,0 +1,72 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u2
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC += matrix.c
|
@ -1,78 +1,3 @@
|
||||
SRC += matrix.c \
|
||||
i2c.c \
|
||||
split_util.c \
|
||||
serial.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,74 @@
|
||||
SRC += matrix.c \
|
||||
i2c.c \
|
||||
split_util.c \
|
||||
serial.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
@ -1,74 +1,3 @@
|
||||
|
||||
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?=yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,74 +1,5 @@
|
||||
|
||||
SUBPROJECT_DEFAULT = rev4
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -1,5 +1,3 @@
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,5 @@
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -1,5 +1,3 @@
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,5 @@
|
||||
AUDIO_ENABLE ?= yes # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,67 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
@ -1,73 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
@ -1,74 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
endif
|
@ -0,0 +1,68 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,75 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -1,70 +1,3 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
@ -0,0 +1,66 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
@ -1,75 +1,3 @@
|
||||
|
||||
|
||||
SRC = matrix.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega16u2
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= no # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
endif
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
SRC = matrix.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega16u2
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= no # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
CUSTOM_MATRIX = yes
|
@ -1,75 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,21 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
/**
|
||||
*TV44 keymap definition macro
|
||||
*/
|
||||
#define KEYMAP_TV44( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
|
||||
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
|
||||
K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
|
||||
K37, K38, K39, K40, K41, K42, K43, K44 \
|
||||
) { \
|
||||
{ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \
|
||||
{ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \
|
||||
{ K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \
|
||||
{ K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, KC_NO, K44 } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,425 @@
|
||||
#include "tv44.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _PLOVER 5
|
||||
#define _TOUCHCURSOR 6
|
||||
#define _MOUSECURSOR 7
|
||||
#define _ADJUST 16
|
||||
|
||||
// Keycodes
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
LOWER,
|
||||
RAISE,
|
||||
BACKLIT,
|
||||
EXT_PLV
|
||||
};
|
||||
|
||||
enum macro_keycodes {
|
||||
KC_ALT_TAB,
|
||||
KC_CMD_TAB,
|
||||
KC_CTL_TAB,
|
||||
KC_CMD_SLSH,
|
||||
KC_AG_FIND,
|
||||
KC_AG_AGAIN,
|
||||
KC_AG_UNDO,
|
||||
KC_AG_CUT,
|
||||
KC_AG_COPY,
|
||||
KC_AG_PASTE,
|
||||
KC_AG_DESK_L,
|
||||
KC_AG_DESK_R,
|
||||
KC_AG_TAB_C,
|
||||
KC_AG_TAB_N,
|
||||
KC_AG_TAB_R,
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// Custom macros
|
||||
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
|
||||
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper
|
||||
#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI
|
||||
#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt
|
||||
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
||||
#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor
|
||||
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
||||
#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab
|
||||
#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab
|
||||
#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab
|
||||
#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility)
|
||||
#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings
|
||||
#define AG_AGAIN M(KC_AG_AGAIN)
|
||||
#define AG_UNDO M(KC_AG_UNDO)
|
||||
#define AG_CUT M(KC_AG_CUT)
|
||||
#define AG_COPY M(KC_AG_COPY)
|
||||
#define AG_PASTE M(KC_AG_PASTE)
|
||||
#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and
|
||||
#define AG_D_R M(KC_AG_DESK_R) // Right
|
||||
#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close,
|
||||
#define AG_T_N M(KC_AG_TAB_N) // Tab New, and
|
||||
#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
*
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_QWERTY] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Colemak
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | Shift | Z | X | C | V | B | K | M | , | . | / | Sft/Ent |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_COLEMAK] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
CTL_ESC , KC_A, KC_R,LT_MC(KC_S), KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Dvorak
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | Shift | ; | Q | J | K | X | B | M | W | V | Z | Sft/Ent |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_DVORAK] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
CTL_ESC , KC_A, KC_O,LT_MC(KC_E), KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Lower
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Brite | | | | | | Vol- | Mute |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_LOWER] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
KC_RBRC , KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Raise
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Brite | | | | | | Vol- | Mute |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_RAISE] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | | | | | | | | |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*
|
||||
* The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't
|
||||
* seem to work on Mac. Presumably they'll work under Windows.
|
||||
*/
|
||||
|
||||
[_TOUCHCURSOR] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______ ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
_______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
_______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
_______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Mouse Layer
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | | | | | | | | |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
|
||||
[_MOUSECURSOR] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
_______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______ ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
_______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5 ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
_______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
_______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Plover layer (http://opensteno.org)
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | | S | T | P | H | * | * | F | P | L | T | D |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | TogOut | S | K | W | R | * | * | R | B | G | S | Z |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | Exit | A | O | | | E | U | |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
|
||||
[_PLOVER] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
KC_1 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
EXT_PLV , KC_C , KC_V , XXXXXXX , XXXXXXX , KC_N , KC_M , XXXXXXX ),
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
* | | | | | | | | | | | | Del |
|
||||
* |---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
* | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
|
||||
* |----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
* | | | | | | | | Reset |
|
||||
* `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
*/
|
||||
[_ADJUST] = KEYMAP_TV44(
|
||||
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||
_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,
|
||||
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||
_______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ ,
|
||||
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,
|
||||
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||
_______ , _______ , _______ , _______ , _______ , _______ , _______ , RESET )
|
||||
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
|
||||
};
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL<<_DVORAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case BACKLIT:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_step();
|
||||
#endif
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case PLOVER:
|
||||
if (record->event.pressed) {
|
||||
layer_off(_RAISE);
|
||||
layer_off(_LOWER);
|
||||
layer_off(_ADJUST);
|
||||
layer_on(_PLOVER);
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
keymap_config.raw = eeconfig_read_keymap();
|
||||
keymap_config.nkro = 1;
|
||||
eeconfig_update_keymap(keymap_config.raw);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case EXT_PLV:
|
||||
if (record->event.pressed) {
|
||||
layer_off(_PLOVER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Macro definition
|
||||
*/
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
|
||||
bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc.
|
||||
// Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
|
||||
// quantum/quantum.c
|
||||
if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) {
|
||||
use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case KC_ALT_TAB:
|
||||
if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
|
||||
else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
|
||||
case KC_CMD_TAB:
|
||||
if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
|
||||
else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
|
||||
|
||||
case KC_CTL_TAB:
|
||||
return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END ));
|
||||
case KC_CMD_SLSH:
|
||||
return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END ));
|
||||
|
||||
case KC_AG_FIND:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END );
|
||||
case KC_AG_AGAIN:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END );
|
||||
case KC_AG_UNDO:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END );
|
||||
case KC_AG_CUT:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END );
|
||||
case KC_AG_COPY:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END );
|
||||
case KC_AG_PASTE:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END );
|
||||
|
||||
case KC_AG_DESK_L:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END );
|
||||
case KC_AG_DESK_R:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END );
|
||||
|
||||
case KC_AG_TAB_C:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END );
|
||||
case KC_AG_TAB_N:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END );
|
||||
case KC_AG_TAB_R:
|
||||
return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END );
|
||||
}
|
||||
|
||||
return MACRO_NONE;
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
jeebak's TV44 layout
|
||||
=======================
|
||||
NOTE: This is a port of jeebak's planck layout, for tv44.
|
||||
|
||||
This WIP keymap attempts to minimize fingers straying away from the home row.
|
||||
To aid in this endeavor, when additional modifyer keys to switch layers are
|
||||
needed, they will be mapped to home row keys. The `keymap.c` file will contain
|
||||
the exact changes. The diagrams in this README shows the highlights of the
|
||||
changes from the default mappings.
|
||||
|
||||
I also decided to change all calls to `persistant_default_layer_set()` to
|
||||
`default_layer_set()` since this is my personal perference.
|
||||
|
||||
## Macros
|
||||
```
|
||||
#define ALT_TAB M(KC_ALT_TAB)
|
||||
```
|
||||
|
||||
## Base Layers (Qwerty/Colemak/Dvorak)
|
||||
These base layers are mostly the same as the default mappings. The interesting
|
||||
changes are shown below.
|
||||
|
||||
- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held,
|
||||
- `GUI/;` as `;` and `GUI`,
|
||||
- `Alt/"` as `"` and `Alt`,
|
||||
- `Sft/Ent` as `Enter` and `Shift`, and
|
||||
- `Hyper/Tab` as `Tab` and `Hyper`
|
||||
|
||||
A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped.
|
||||
The arrow keys, which have been moved to the
|
||||
[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been
|
||||
replaced with the Media keys as shown. The `MC/kc` key activates the
|
||||
`MouseCursor` layer when held, and emits the corresponding `kc` for its layer,
|
||||
when tapped.
|
||||
```
|
||||
,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
|Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
|---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
| Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" |
|
||||
|----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
| Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent |
|
||||
|-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
| Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play |
|
||||
`--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
```
|
||||
|
||||
## Lower Layer (Symbols and Function Keys)
|
||||
The symbols and functions keys are essentially the same as the default mapping.
|
||||
The most notable changes are that the symbol keys from the `RAISE` layer have
|
||||
been moved here. The remaining Media keys replace those that are now on the
|
||||
base layers. The `BACKLIT` key has also been moved here.
|
||||
```
|
||||
,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
|---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
| [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" |
|
||||
|----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
| ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ |
|
||||
|-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
| Brite | | | | | | Vol- | Mute |
|
||||
`--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
```
|
||||
|
||||
## Raise Layer (Numbers and Arithmetic Operators)
|
||||
All of the numbers and arithmetic operators are available on this layer. Some
|
||||
keys are duplicated for the convenience of their positions. The `0` and `$`
|
||||
keys at the far left are for quick access to beginning and end of line in vim.
|
||||
```
|
||||
,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
|---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
| $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" |
|
||||
|----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
| = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ |
|
||||
|-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
| Brite | | | | | | Vol- | Mute |
|
||||
`--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
```
|
||||
|
||||
## TouchCursor layer plus personal customizations
|
||||
[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key
|
||||
as the modifier, with the `IJKL` home row keys representing the inverted-T of
|
||||
the arrow keys. All of the default TouchCursor keymappings for the right hand
|
||||
are represented below. My personalizations include all of the keys shown for
|
||||
the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key
|
||||
from the base layers) readily accessible from the home row allows quick word
|
||||
jumps and highlighting when used in conjunction with the arrow keys. The
|
||||
`Alt-Tab` macro is not only useful under Windows, but also under Mac when used
|
||||
with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch).
|
||||
The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in
|
||||
this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN`
|
||||
keycodes do not seem to work. There are macros in place that'll "automatically"
|
||||
choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`,
|
||||
etc.) depending on which layout you've currently selected (`AG_NORM` or
|
||||
`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I
|
||||
use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and
|
||||
`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as
|
||||
Google Chrome.
|
||||
```
|
||||
,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
| AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | |
|
||||
|---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
| | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R |
|
||||
|----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
| | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| |
|
||||
|-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
| | | | | | | | |
|
||||
`--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
```
|
||||
|
||||
## Mouse Layer
|
||||
The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer.
|
||||
The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the
|
||||
mouse from the `doc/keycode.txt` file are represented, and logically located,
|
||||
IMHO. The left and right click buttons are duplicated; on the right hand side,
|
||||
for a quick click here and there, and again on the left hand side for when the
|
||||
buttons need to be held for dragging things or highlighting text, thus allowing
|
||||
the right hand to be free to use the up/down/left/right actions.
|
||||
```
|
||||
,---------+------+------+------+------+------+------+------+------+------+------+-------------.
|
||||
| | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | |
|
||||
|---------`------`------`------`------`------`------`------`------`------`------`-------------|
|
||||
| |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 |
|
||||
|----------`------`------`------`------`------`------`------`------`------`------`------------|
|
||||
| | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | |
|
||||
|-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
|
||||
| | | | | | | | |
|
||||
`--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
|
||||
```
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -1,76 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = at90usb1286
|
||||
# MCU = at90usb1287
|
||||
# MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = at90usb1286
|
||||
# MCU = at90usb1287
|
||||
# MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -0,0 +1 @@
|
||||
Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780
|
@ -0,0 +1,79 @@
|
||||
COLOR ?= true
|
||||
|
||||
ifeq ($(COLOR),true)
|
||||
NO_COLOR=\033[0m
|
||||
OK_COLOR=\033[32;01m
|
||||
ERROR_COLOR=\033[31;01m
|
||||
WARN_COLOR=\033[33;01m
|
||||
BLUE=\033[0;34m
|
||||
BOLD=\033[1m
|
||||
endif
|
||||
|
||||
ifneq ($(shell awk --version 2>/dev/null),)
|
||||
AWK=awk
|
||||
else
|
||||
AWK=cat && test
|
||||
endif
|
||||
|
||||
ON_ERROR ?= exit 1
|
||||
|
||||
OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
|
||||
ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
|
||||
WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
|
||||
|
||||
TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }'
|
||||
TAB_LOG_PLAIN = printf "$$LOG\n"
|
||||
AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
|
||||
AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
|
||||
PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR)
|
||||
PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
|
||||
PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR)
|
||||
PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
|
||||
PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
|
||||
BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
|
||||
MAKE_MSG_FORMAT = $(AWK) '{ printf "%-118s", $$0;}'
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR)
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_BIN = Creating binary load file for Flash:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_COMPILING_CPP = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
MSG_CREATING_LIBRARY = Creating library:
|
||||
MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
|
||||
Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\
|
||||
git submodule sync --recursive\n\
|
||||
git submodule update --init --recursive$(NO_COLOR)\n\n\
|
||||
You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
|
||||
or if you have modified the ChibiOS libraries yourself. \n\n
|
||||
MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
|
||||
|
||||
define GENERATE_MSG_MAKE_KB
|
||||
MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR)
|
||||
ifneq ($$(MAKE_TARGET),)
|
||||
MSG_MAKE_KB_ACTUAL += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
|
||||
endif
|
||||
endef
|
||||
MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL)
|
||||
define GENERATE_MSG_MAKE_TEST
|
||||
MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_NAME)$(NO_COLOR)
|
||||
ifneq ($$(MAKE_TARGET),)
|
||||
MSG_MAKE_TEST_ACTUAL += with target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
|
||||
endif
|
||||
endef
|
||||
MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL)
|
||||
MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR)
|
@ -1,231 +0,0 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Fred Sundvik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <cgreen/cgreen.h>
|
||||
#include <cgreen/mocks.h>
|
||||
#include "serial_link/protocol/byte_stuffer.c"
|
||||
#include "serial_link/protocol/frame_validator.c"
|
||||
#include "serial_link/protocol/frame_router.c"
|
||||
#include "serial_link/protocol/transport.h"
|
||||
|
||||
static uint8_t received_data[256];
|
||||
static uint16_t received_data_size;
|
||||
|
||||
typedef struct {
|
||||
uint8_t sent_data[256];
|
||||
uint16_t sent_data_size;
|
||||
} receive_buffer_t;
|
||||
|
||||
typedef struct {
|
||||
receive_buffer_t send_buffers[2];
|
||||
} router_buffer_t;
|
||||
|
||||
router_buffer_t router_buffers[8];
|
||||
|
||||
router_buffer_t* current_router_buffer;
|
||||
|
||||
|
||||
Describe(FrameRouter);
|
||||
BeforeEach(FrameRouter) {
|
||||
init_byte_stuffer();
|
||||
memset(router_buffers, 0, sizeof(router_buffers));
|
||||
current_router_buffer = 0;
|
||||
}
|
||||
AfterEach(FrameRouter) {}
|
||||
|
||||
typedef struct {
|
||||
uint32_t data;
|
||||
uint8_t extra[16];
|
||||
} frame_buffer_t;
|
||||
|
||||
|
||||
void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
|
||||
receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link];
|
||||
memcpy(buffer->sent_data + buffer->sent_data_size, data, size);
|
||||
buffer->sent_data_size += size;
|
||||
}
|
||||
|
||||
static void receive_data(uint8_t link, uint8_t* data, uint16_t size) {
|
||||
int i;
|
||||
for(i=0;i<size;i++) {
|
||||
byte_stuffer_recv_byte(link, data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void activate_router(uint8_t num) {
|
||||
current_router_buffer = router_buffers + num;
|
||||
router_set_master(num==0);
|
||||
}
|
||||
|
||||
static void simulate_transport(uint8_t from, uint8_t to) {
|
||||
activate_router(to);
|
||||
if (from > to) {
|
||||
receive_data(DOWN_LINK,
|
||||
router_buffers[from].send_buffers[UP_LINK].sent_data,
|
||||
router_buffers[from].send_buffers[UP_LINK].sent_data_size);
|
||||
}
|
||||
else if(to > from) {
|
||||
receive_data(UP_LINK,
|
||||
router_buffers[from].send_buffers[DOWN_LINK].sent_data,
|
||||
router_buffers[from].send_buffers[DOWN_LINK].sent_data_size);
|
||||
}
|
||||
}
|
||||
|
||||
void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) {
|
||||
mock(from, data, size);
|
||||
}
|
||||
|
||||
|
||||
Ensure(FrameRouter, master_broadcast_is_received_by_everyone) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(0);
|
||||
router_send_frame(0xFF, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(0)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(0, 1);
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(0)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(1, 2);
|
||||
assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, master_send_is_received_by_targets) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(0);
|
||||
router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
simulate_transport(0, 1);
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(0)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(1, 2);
|
||||
assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(0)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(2, 3);
|
||||
assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, first_link_sends_to_master) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(1);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(1)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(1, 0);
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, second_link_sends_to_master) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(2);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
simulate_transport(2, 1);
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
expect(transport_recv_frame,
|
||||
when(from, is_equal_to(2)),
|
||||
when(size, is_equal_to(4)),
|
||||
when(data, is_equal_to_contents_of(&data.data, 4))
|
||||
);
|
||||
simulate_transport(1, 0);
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, master_sends_to_master_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(0);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, link_sends_to_other_link_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(1);
|
||||
router_send_frame(2, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
||||
|
||||
Ensure(FrameRouter, master_receives_on_uplink_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = 0xAB7055BB;
|
||||
activate_router(1);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
|
||||
assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
|
||||
never_expect(transport_recv_frame);
|
||||
activate_router(0);
|
||||
receive_data(UP_LINK,
|
||||
router_buffers[1].send_buffers[UP_LINK].sent_data,
|
||||
router_buffers[1].send_buffers[UP_LINK].sent_data_size);
|
||||
assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
|
||||
assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Fred Sundvik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include <array>
|
||||
extern "C" {
|
||||
#include "serial_link/protocol/transport.h"
|
||||
#include "serial_link/protocol/byte_stuffer.h"
|
||||
#include "serial_link/protocol/frame_router.h"
|
||||
}
|
||||
|
||||
using testing::_;
|
||||
using testing::ElementsAreArray;
|
||||
using testing::Args;
|
||||
|
||||
class FrameRouter : public testing::Test {
|
||||
public:
|
||||
FrameRouter() :
|
||||
current_router_buffer(nullptr)
|
||||
{
|
||||
Instance = this;
|
||||
init_byte_stuffer();
|
||||
}
|
||||
|
||||
~FrameRouter() {
|
||||
Instance = nullptr;
|
||||
}
|
||||
|
||||
void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
|
||||
auto& buffer = current_router_buffer->send_buffers[link];
|
||||
std::copy(data, data + size, std::back_inserter(buffer));
|
||||
}
|
||||
|
||||
void receive_data(uint8_t link, uint8_t* data, uint16_t size) {
|
||||
int i;
|
||||
for(i=0;i<size;i++) {
|
||||
byte_stuffer_recv_byte(link, data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void activate_router(uint8_t num) {
|
||||
current_router_buffer = router_buffers + num;
|
||||
router_set_master(num==0);
|
||||
}
|
||||
|
||||
void simulate_transport(uint8_t from, uint8_t to) {
|
||||
activate_router(to);
|
||||
if (from > to) {
|
||||
receive_data(DOWN_LINK,
|
||||
router_buffers[from].send_buffers[UP_LINK].data(),
|
||||
router_buffers[from].send_buffers[UP_LINK].size());
|
||||
}
|
||||
else if(to > from) {
|
||||
receive_data(UP_LINK,
|
||||
router_buffers[from].send_buffers[DOWN_LINK].data(),
|
||||
router_buffers[from].send_buffers[DOWN_LINK].size());
|
||||
}
|
||||
}
|
||||
|
||||
MOCK_METHOD3(transport_recv_frame, void (uint8_t from, uint8_t* data, uint16_t size));
|
||||
|
||||
std::vector<uint8_t> received_data;
|
||||
|
||||
struct router_buffer {
|
||||
std::vector<uint8_t> send_buffers[2];
|
||||
};
|
||||
|
||||
router_buffer router_buffers[8];
|
||||
router_buffer* current_router_buffer;
|
||||
|
||||
static FrameRouter* Instance;
|
||||
};
|
||||
|
||||
FrameRouter* FrameRouter::Instance = nullptr;
|
||||
|
||||
|
||||
typedef struct {
|
||||
std::array<uint8_t, 4> data;
|
||||
uint8_t extra[16];
|
||||
} frame_buffer_t;
|
||||
|
||||
|
||||
extern "C" {
|
||||
void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
|
||||
FrameRouter::Instance->send_data(link, data, size);
|
||||
}
|
||||
|
||||
|
||||
void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) {
|
||||
FrameRouter::Instance->transport_recv_frame(from, data, size);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, master_broadcast_is_received_by_everyone) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(0);
|
||||
router_send_frame(0xFF, (uint8_t*)&data, 4);
|
||||
EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_CALL(*this, transport_recv_frame(0, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(0, 1);
|
||||
EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(0, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(1, 2);
|
||||
EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, master_send_is_received_by_targets) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(0);
|
||||
router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4);
|
||||
EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
|
||||
simulate_transport(0, 1);
|
||||
EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(0, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(1, 2);
|
||||
EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(0, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(2, 3);
|
||||
EXPECT_GT(router_buffers[3].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[3].send_buffers[UP_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, first_link_sends_to_master) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(1);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(1, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(1, 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, second_link_sends_to_master) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(2);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
EXPECT_GT(router_buffers[2].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
|
||||
|
||||
simulate_transport(2, 1);
|
||||
EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(2, _, _))
|
||||
.With(Args<1, 2>(ElementsAreArray(data.data)));
|
||||
simulate_transport(1, 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, master_sends_to_master_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(0);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, link_sends_to_other_link_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(1);
|
||||
router_send_frame(2, (uint8_t*)&data, 4);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
}
|
||||
|
||||
TEST_F(FrameRouter, master_receives_on_uplink_does_nothing) {
|
||||
frame_buffer_t data;
|
||||
data.data = {0xAB, 0x70, 0x55, 0xBB};
|
||||
activate_router(1);
|
||||
router_send_frame(0, (uint8_t*)&data, 4);
|
||||
EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
|
||||
|
||||
EXPECT_CALL(*this, transport_recv_frame(_, _, _))
|
||||
.Times(0);
|
||||
activate_router(0);
|
||||
receive_data(UP_LINK,
|
||||
router_buffers[1].send_buffers[UP_LINK].data(),
|
||||
router_buffers[1].send_buffers[UP_LINK].size());
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
|
||||
EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
serial_link_byte_stuffer_SRC :=\
|
||||
$(SERIAL_PATH)/tests/byte_stuffer_tests.cpp \
|
||||
$(SERIAL_PATH)/protocol/byte_stuffer.c
|
||||
|
||||
serial_link_frame_validator_SRC := \
|
||||
$(SERIAL_PATH)/tests/frame_validator_tests.cpp \
|
||||
$(SERIAL_PATH)/protocol/frame_validator.c
|
||||
|
||||
serial_link_frame_router_SRC := \
|
||||
$(SERIAL_PATH)/tests/frame_router_tests.cpp \
|
||||
$(SERIAL_PATH)/protocol/byte_stuffer.c \
|
||||
$(SERIAL_PATH)/protocol/frame_validator.c \
|
||||
$(SERIAL_PATH)/protocol/frame_router.c
|
||||
|
||||
serial_link_triple_buffered_object_SRC := \
|
||||
$(SERIAL_PATH)/tests/triple_buffered_object_tests.cpp \
|
||||
$(SERIAL_PATH)/protocol/triple_buffered_object.c
|
||||
|
||||
serial_link_transport_SRC := \
|
||||
$(SERIAL_PATH)/tests/transport_tests.cpp \
|
||||
$(SERIAL_PATH)/protocol/transport.c \
|
||||
$(SERIAL_PATH)/protocol/triple_buffered_object.c
|
@ -0,0 +1,6 @@
|
||||
TEST_LIST +=\
|
||||
serial_link_byte_stuffer\
|
||||
serial_link_frame_validator\
|
||||
serial_link_frame_router\
|
||||
serial_link_triple_buffered_object\
|
||||
serial_link_transport
|
@ -1,168 +0,0 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Fred Sundvik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <cgreen/cgreen.h>
|
||||
#include <cgreen/mocks.h>
|
||||
#include "serial_link/protocol/transport.c"
|
||||
#include "serial_link/protocol/triple_buffered_object.c"
|
||||
|
||||
void signal_data_written(void) {
|
||||
mock();
|
||||
}
|
||||
|
||||
static uint8_t sent_data[2048];
|
||||
static uint16_t sent_data_size;
|
||||
|
||||
void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
|
||||
mock(destination);
|
||||
memcpy(sent_data + sent_data_size, data, size);
|
||||
sent_data_size += size;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint32_t test;
|
||||
} test_object1_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t test1;
|
||||
uint32_t test2;
|
||||
} test_object2_t;
|
||||
|
||||
MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t);
|
||||
MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t);
|
||||
SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t);
|
||||
|
||||
static remote_object_t* test_remote_objects[] = {
|
||||
REMOTE_OBJECT(master_to_slave),
|
||||
REMOTE_OBJECT(master_to_single_slave),
|
||||
REMOTE_OBJECT(slave_to_master),
|
||||
};
|
||||
|
||||
Describe(Transport);
|
||||
BeforeEach(Transport) {
|
||||
add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*));
|
||||
sent_data_size = 0;
|
||||
}
|
||||
AfterEach(Transport) {}
|
||||
|
||||
Ensure(Transport, write_to_local_signals_an_event) {
|
||||
begin_write_master_to_slave();
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_slave();
|
||||
begin_write_slave_to_master();
|
||||
expect(signal_data_written);
|
||||
end_write_slave_to_master();
|
||||
begin_write_master_to_single_slave(1);
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_single_slave(1);
|
||||
}
|
||||
|
||||
Ensure(Transport, writes_from_master_to_all_slaves) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_master_to_slave();
|
||||
obj->test = 5;
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_slave();
|
||||
expect(router_send_frame,
|
||||
when(destination, is_equal_to(0xFF)));
|
||||
update_transport();
|
||||
transport_recv_frame(0, sent_data, sent_data_size);
|
||||
test_object1_t* obj2 = read_master_to_slave();
|
||||
assert_that(obj2, is_not_equal_to(NULL));
|
||||
assert_that(obj2->test, is_equal_to(5));
|
||||
}
|
||||
|
||||
Ensure(Transport, writes_from_slave_to_master) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_slave_to_master();
|
||||
obj->test = 7;
|
||||
expect(signal_data_written);
|
||||
end_write_slave_to_master();
|
||||
expect(router_send_frame,
|
||||
when(destination, is_equal_to(0)));
|
||||
update_transport();
|
||||
transport_recv_frame(3, sent_data, sent_data_size);
|
||||
test_object1_t* obj2 = read_slave_to_master(2);
|
||||
assert_that(read_slave_to_master(0), is_equal_to(NULL));
|
||||
assert_that(obj2, is_not_equal_to(NULL));
|
||||
assert_that(obj2->test, is_equal_to(7));
|
||||
}
|
||||
|
||||
Ensure(Transport, writes_from_master_to_single_slave) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_master_to_single_slave(3);
|
||||
obj->test = 7;
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_single_slave(3);
|
||||
expect(router_send_frame,
|
||||
when(destination, is_equal_to(4)));
|
||||
update_transport();
|
||||
transport_recv_frame(0, sent_data, sent_data_size);
|
||||
test_object1_t* obj2 = read_master_to_single_slave();
|
||||
assert_that(obj2, is_not_equal_to(NULL));
|
||||
assert_that(obj2->test, is_equal_to(7));
|
||||
}
|
||||
|
||||
Ensure(Transport, ignores_object_with_invalid_id) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_master_to_single_slave(3);
|
||||
obj->test = 7;
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_single_slave(3);
|
||||
expect(router_send_frame,
|
||||
when(destination, is_equal_to(4)));
|
||||
update_transport();
|
||||
sent_data[sent_data_size - 1] = 44;
|
||||
transport_recv_frame(0, sent_data, sent_data_size);
|
||||
test_object1_t* obj2 = read_master_to_single_slave();
|
||||
assert_that(obj2, is_equal_to(NULL));
|
||||
}
|
||||
|
||||
Ensure(Transport, ignores_object_with_size_too_small) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_master_to_slave();
|
||||
obj->test = 7;
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_slave();
|
||||
expect(router_send_frame);
|
||||
update_transport();
|
||||
sent_data[sent_data_size - 2] = 0;
|
||||
transport_recv_frame(0, sent_data, sent_data_size - 1);
|
||||
test_object1_t* obj2 = read_master_to_slave();
|
||||
assert_that(obj2, is_equal_to(NULL));
|
||||
}
|
||||
|
||||
Ensure(Transport, ignores_object_with_size_too_big) {
|
||||
update_transport();
|
||||
test_object1_t* obj = begin_write_master_to_slave();
|
||||
obj->test = 7;
|
||||
expect(signal_data_written);
|
||||
end_write_master_to_slave();
|
||||
expect(router_send_frame);
|
||||
update_transport();
|
||||
sent_data[sent_data_size + 21] = 0;
|
||||
transport_recv_frame(0, sent_data, sent_data_size + 22);
|
||||
test_object1_t* obj2 = read_master_to_slave();
|
||||
assert_that(obj2, is_equal_to(NULL));
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Fred Sundvik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
using testing::_;
|
||||
using testing::ElementsAreArray;
|
||||
using testing::Args;
|
||||
|
||||
extern "C" {
|
||||
#include "serial_link/protocol/transport.h"
|
||||
}
|
||||
|
||||
struct test_object1 {
|
||||
uint32_t test;
|
||||
};
|
||||
|
||||
struct test_object2 {
|
||||
uint32_t test1;
|
||||
uint32_t test2;
|
||||
};
|
||||
|
||||
MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1);
|
||||
MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1);
|
||||
SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1);
|
||||
|
||||
static remote_object_t* test_remote_objects[] = {
|
||||
REMOTE_OBJECT(master_to_slave),
|
||||
REMOTE_OBJECT(master_to_single_slave),
|
||||
REMOTE_OBJECT(slave_to_master),
|
||||
};
|
||||
|
||||
class Transport : public testing::Test {
|
||||
public:
|
||||
Transport() {
|
||||
Instance = this;
|
||||
add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*));
|
||||
}
|
||||
|
||||
~Transport() {
|
||||
Instance = nullptr;
|
||||
reinitialize_serial_link_transport();
|
||||
}
|
||||
|
||||
MOCK_METHOD0(signal_data_written, void ());
|
||||
MOCK_METHOD1(router_send_frame, void (uint8_t destination));
|
||||
|
||||
void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
|
||||
router_send_frame(destination);
|
||||
std::copy(data, data + size, std::back_inserter(sent_data));
|
||||
}
|
||||
|
||||
static Transport* Instance;
|
||||
|
||||
std::vector<uint8_t> sent_data;
|
||||
};
|
||||
|
||||
Transport* Transport::Instance = nullptr;
|
||||
|
||||
extern "C" {
|
||||
void signal_data_written(void) {
|
||||
Transport::Instance->signal_data_written();
|
||||
}
|
||||
|
||||
void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
|
||||
Transport::Instance->router_send_frame(destination, data, size);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(Transport, write_to_local_signals_an_event) {
|
||||
begin_write_master_to_slave();
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_slave();
|
||||
begin_write_slave_to_master();
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_slave_to_master();
|
||||
begin_write_master_to_single_slave(1);
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_single_slave(1);
|
||||
}
|
||||
|
||||
TEST_F(Transport, writes_from_master_to_all_slaves) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_master_to_slave();
|
||||
obj->test = 5;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_slave();
|
||||
EXPECT_CALL(*this, router_send_frame(0xFF));
|
||||
update_transport();
|
||||
transport_recv_frame(0, sent_data.data(), sent_data.size());
|
||||
test_object1* obj2 = read_master_to_slave();
|
||||
EXPECT_NE(obj2, nullptr);
|
||||
EXPECT_EQ(obj2->test, 5);
|
||||
}
|
||||
|
||||
TEST_F(Transport, writes_from_slave_to_master) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_slave_to_master();
|
||||
obj->test = 7;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_slave_to_master();
|
||||
EXPECT_CALL(*this, router_send_frame(0));
|
||||
update_transport();
|
||||
transport_recv_frame(3, sent_data.data(), sent_data.size());
|
||||
test_object1* obj2 = read_slave_to_master(2);
|
||||
EXPECT_EQ(read_slave_to_master(0), nullptr);
|
||||
EXPECT_NE(obj2, nullptr);
|
||||
EXPECT_EQ(obj2->test, 7);
|
||||
}
|
||||
|
||||
TEST_F(Transport, writes_from_master_to_single_slave) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_master_to_single_slave(3);
|
||||
obj->test = 7;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_single_slave(3);
|
||||
EXPECT_CALL(*this, router_send_frame(4));
|
||||
update_transport();
|
||||
transport_recv_frame(0, sent_data.data(), sent_data.size());
|
||||
test_object1* obj2 = read_master_to_single_slave();
|
||||
EXPECT_NE(obj2, nullptr);
|
||||
EXPECT_EQ(obj2->test, 7);
|
||||
}
|
||||
|
||||
TEST_F(Transport, ignores_object_with_invalid_id) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_master_to_single_slave(3);
|
||||
obj->test = 7;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_single_slave(3);
|
||||
EXPECT_CALL(*this, router_send_frame(4));
|
||||
update_transport();
|
||||
sent_data[sent_data.size() - 1] = 44;
|
||||
transport_recv_frame(0, sent_data.data(), sent_data.size());
|
||||
test_object1* obj2 = read_master_to_single_slave();
|
||||
EXPECT_EQ(obj2, nullptr);
|
||||
}
|
||||
|
||||
TEST_F(Transport, ignores_object_with_size_too_small) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_master_to_slave();
|
||||
obj->test = 7;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_slave();
|
||||
EXPECT_CALL(*this, router_send_frame(_));
|
||||
update_transport();
|
||||
sent_data[sent_data.size() - 2] = 0;
|
||||
transport_recv_frame(0, sent_data.data(), sent_data.size() - 1);
|
||||
test_object1* obj2 = read_master_to_slave();
|
||||
EXPECT_EQ(obj2, nullptr);
|
||||
}
|
||||
|
||||
TEST_F(Transport, ignores_object_with_size_too_big) {
|
||||
update_transport();
|
||||
test_object1* obj = begin_write_master_to_slave();
|
||||
obj->test = 7;
|
||||
EXPECT_CALL(*this, signal_data_written());
|
||||
end_write_master_to_slave();
|
||||
EXPECT_CALL(*this, router_send_frame(_));
|
||||
update_transport();
|
||||
sent_data.resize(sent_data.size() + 22);
|
||||
sent_data[sent_data.size() - 1] = 0;
|
||||
transport_recv_frame(0, sent_data.data(), sent_data.size());
|
||||
test_object1* obj2 = read_master_to_slave();
|
||||
EXPECT_EQ(obj2, nullptr);
|
||||
}
|
@ -1,75 +1,3 @@
|
||||
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
||||
endif
|
@ -0,0 +1,67 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -0,0 +1,13 @@
|
||||
include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk
|
||||
|
||||
define VALIDATE_TEST_LIST
|
||||
ifneq ($1,)
|
||||
ifeq ($$(findstring -,$1),-)
|
||||
$$(error Test names can't contain '-', but '$1' does)
|
||||
else
|
||||
$$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2)))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST))))
|
@ -1,500 +1,500 @@
|
||||
;---------------------------------------------------------------------------;
|
||||
; Extended itoa, puts, printf and atoi (C)ChaN, 2011
|
||||
;---------------------------------------------------------------------------;
|
||||
|
||||
// Base size is 152 bytes
|
||||
#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes)
|
||||
#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes)
|
||||
#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes)
|
||||
#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes)
|
||||
#define USE_XATOI 0 // Enable xatoi function (+182 bytes)
|
||||
|
||||
|
||||
#if FLASHEND > 0x1FFFF
|
||||
#error xitoa module does not support 256K devices
|
||||
#endif
|
||||
|
||||
.nolist
|
||||
#include <avr/io.h> // Include device specific definitions.
|
||||
.list
|
||||
|
||||
#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw".
|
||||
.macro _LPMI reg
|
||||
lpm \reg, Z+
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
movw \dl, \sl
|
||||
.endm
|
||||
#else // Earlier devices do not have "lpm Rd,Z+" nor "movw".
|
||||
.macro _LPMI reg
|
||||
lpm
|
||||
mov \reg, r0
|
||||
adiw ZL, 1
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
mov \dl, \sl
|
||||
mov \dh, \sh
|
||||
.endm
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Stub function to forward to user output function
|
||||
;
|
||||
;Prototype: void xputc (char chr // a character to be output
|
||||
; );
|
||||
;Size: 12/12 words
|
||||
|
||||
.section .bss
|
||||
.global xfunc_out ; xfunc_out must be initialized before using this module.
|
||||
xfunc_out: .ds.w 1
|
||||
.section .text
|
||||
|
||||
|
||||
.func xputc
|
||||
.global xputc
|
||||
xputc:
|
||||
#if CR_CRLF
|
||||
cpi r24, 10 ;LF --> CRLF
|
||||
brne 1f ;
|
||||
ldi r24, 13 ;
|
||||
rcall 1f ;
|
||||
ldi r24, 10 ;/
|
||||
1:
|
||||
#endif
|
||||
push ZH
|
||||
push ZL
|
||||
lds ZL, xfunc_out+0 ;Pointer to the registered output function.
|
||||
lds ZH, xfunc_out+1 ;/
|
||||
sbiw ZL, 0 ;Skip if null
|
||||
breq 2f ;/
|
||||
icall
|
||||
2: pop ZL
|
||||
pop ZH
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Direct ROM string output
|
||||
;
|
||||
;Prototype: void xputs (const char *str_p // rom string to be output
|
||||
; );
|
||||
|
||||
.func xputs
|
||||
.global xputs
|
||||
xputs:
|
||||
_MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string
|
||||
1: _LPMI r24
|
||||
cpi r24, 0
|
||||
breq 2f
|
||||
rcall xputc
|
||||
rjmp 1b
|
||||
2: ret
|
||||
.endfunc
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Extended direct numeral string output (32bit version)
|
||||
;
|
||||
;Prototype: void xitoa (long value, // value to be output
|
||||
; char radix, // radix
|
||||
; char width); // minimum width
|
||||
;
|
||||
|
||||
.func xitoa
|
||||
.global xitoa
|
||||
xitoa:
|
||||
;r25:r22 = value, r20 = base, r18 = digits
|
||||
clr r31 ;r31 = stack level
|
||||
ldi r30, ' ' ;r30 = sign
|
||||
ldi r19, ' ' ;r19 = filler
|
||||
sbrs r20, 7 ;When base indicates signd format and the value
|
||||
rjmp 0f ;is minus, add a '-'.
|
||||
neg r20 ;
|
||||
sbrs r25, 7 ;
|
||||
rjmp 0f ;
|
||||
ldi r30, '-' ;
|
||||
com r22 ;
|
||||
com r23 ;
|
||||
com r24 ;
|
||||
com r25 ;
|
||||
adc r22, r1 ;
|
||||
adc r23, r1 ;
|
||||
adc r24, r1 ;
|
||||
adc r25, r1 ;/
|
||||
0: sbrs r18, 7 ;When digits indicates zero filled,
|
||||
rjmp 1f ;filler is '0'.
|
||||
neg r18 ;
|
||||
ldi r19, '0' ;/
|
||||
;----- string conversion loop
|
||||
1: ldi r21, 32 ;r26 = r25:r22 % r20
|
||||
clr r26 ;r25:r22 /= r20
|
||||
2: lsl r22 ;
|
||||
rol r23 ;
|
||||
rol r24 ;
|
||||
rol r25 ;
|
||||
rol r26 ;
|
||||
cp r26, r20 ;
|
||||
brcs 3f ;
|
||||
sub r26, r20 ;
|
||||
inc r22 ;
|
||||
3: dec r21 ;
|
||||
brne 2b ;/
|
||||
cpi r26, 10 ;r26 is a numeral digit '0'-'F'
|
||||
brcs 4f ;
|
||||
subi r26, -7 ;
|
||||
4: subi r26, -'0' ;/
|
||||
push r26 ;Stack it
|
||||
inc r31 ;/
|
||||
cp r22, r1 ;Repeat until r25:r22 gets zero
|
||||
cpc r23, r1 ;
|
||||
cpc r24, r1 ;
|
||||
cpc r25, r1 ;
|
||||
brne 1b ;/
|
||||
|
||||
cpi r30, '-' ;Minus sign if needed
|
||||
brne 5f ;
|
||||
push r30 ;
|
||||
inc r31 ;/
|
||||
5: cp r31, r18 ;Filler
|
||||
brcc 6f ;
|
||||
push r19 ;
|
||||
inc r31 ;
|
||||
rjmp 5b ;/
|
||||
|
||||
6: pop r24 ;Flush stacked digits and exit
|
||||
rcall xputc ;
|
||||
dec r31 ;
|
||||
brne 6b ;/
|
||||
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Formatted string output (16/32bit version)
|
||||
;
|
||||
;Prototype:
|
||||
; void __xprintf (const char *format_p, ...);
|
||||
; void __xsprintf(char*, const char *format_p, ...);
|
||||
; void __xfprintf(void(*func)(char), const char *format_p, ...);
|
||||
;
|
||||
|
||||
#if USE_XPRINTF
|
||||
|
||||
.func xvprintf
|
||||
xvprintf:
|
||||
ld ZL, Y+ ;Z = pointer to format string
|
||||
ld ZH, Y+ ;/
|
||||
|
||||
0: _LPMI r24 ;Get a format char
|
||||
cpi r24, 0 ;End of format string?
|
||||
breq 90f ;/
|
||||
cpi r24, '%' ;Is format?
|
||||
breq 20f ;/
|
||||
1: rcall xputc ;Put a normal character
|
||||
rjmp 0b ;/
|
||||
90: ret
|
||||
|
||||
20: ldi r18, 0 ;r18: digits
|
||||
clt ;T: filler
|
||||
_LPMI r21 ;Get flags
|
||||
cpi r21, '%' ;Is a %?
|
||||
breq 1b ;/
|
||||
cpi r21, '0' ;Zero filled?
|
||||
brne 23f ;
|
||||
set ;/
|
||||
22: _LPMI r21 ;Get width
|
||||
23: cpi r21, '9'+1 ;
|
||||
brcc 24f ;
|
||||
subi r21, '0' ;
|
||||
brcs 90b ;
|
||||
lsl r18 ;
|
||||
mov r0, r18 ;
|
||||
lsl r18 ;
|
||||
lsl r18 ;
|
||||
add r18, r0 ;
|
||||
add r18, r21 ;
|
||||
rjmp 22b ;/
|
||||
|
||||
24: brtc 25f ;get value (low word)
|
||||
neg r18 ;
|
||||
25: ld r24, Y+ ;
|
||||
ld r25, Y+ ;/
|
||||
cpi r21, 'c' ;Is type character?
|
||||
breq 1b ;/
|
||||
cpi r21, 's' ;Is type RAM string?
|
||||
breq 50f ;/
|
||||
cpi r21, 'S' ;Is type ROM string?
|
||||
breq 60f ;/
|
||||
_MOVW r23,r22,r25,r24 ;r25:r22 = value
|
||||
clr r24 ;
|
||||
clr r25 ;
|
||||
clt ;/
|
||||
cpi r21, 'l' ;Is long int?
|
||||
brne 26f ;
|
||||
ld r24, Y+ ;get value (high word)
|
||||
ld r25, Y+ ;
|
||||
set ;
|
||||
_LPMI r21 ;/
|
||||
26: cpi r21, 'd' ;Is type signed decimal?
|
||||
brne 27f ;/
|
||||
ldi r20, -10 ;
|
||||
brts 40f ;
|
||||
sbrs r23, 7 ;
|
||||
rjmp 40f ;
|
||||
ldi r24, -1 ;
|
||||
ldi r25, -1 ;
|
||||
rjmp 40f ;/
|
||||
27: cpi r21, 'u' ;Is type unsigned decimal?
|
||||
ldi r20, 10 ;
|
||||
breq 40f ;/
|
||||
cpi r21, 'X' ;Is type hexdecimal?
|
||||
ldi r20, 16 ;
|
||||
breq 40f ;/
|
||||
cpi r21, 'b' ;Is type binary?
|
||||
ldi r20, 2 ;
|
||||
breq 40f ;/
|
||||
ret ;abort
|
||||
40: push ZH ;Output the value
|
||||
push ZL ;
|
||||
rcall xitoa ;
|
||||
42: pop ZL ;
|
||||
pop ZH ;
|
||||
rjmp 0b ;/
|
||||
|
||||
50: push ZH ;Put a string on the RAM
|
||||
push ZL
|
||||
_MOVW ZH,ZL, r25,r24
|
||||
51: ld r24, Z+
|
||||
cpi r24, 0
|
||||
breq 42b
|
||||
rcall xputc
|
||||
rjmp 51b
|
||||
|
||||
60: push ZH ;Put a string on the ROM
|
||||
push ZL
|
||||
rcall xputs
|
||||
rjmp 42b
|
||||
.endfunc
|
||||
|
||||
|
||||
.func __xprintf
|
||||
.global __xprintf
|
||||
__xprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
rcall xvprintf
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
#if USE_XSPRINTF
|
||||
|
||||
.func __xsprintf
|
||||
putram:
|
||||
_MOVW ZH,ZL, r15,r14
|
||||
st Z+, r24
|
||||
_MOVW r15,r14, ZH,ZL
|
||||
ret
|
||||
.global __xsprintf
|
||||
__xsprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
lds ZL, xfunc_out+0 ;Save registered output function
|
||||
lds ZH, xfunc_out+1 ;
|
||||
push ZL ;
|
||||
push ZH ;/
|
||||
ldi ZL, lo8(pm(putram));Set local output function
|
||||
ldi ZH, hi8(pm(putram));
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
push r15 ;Initialize pointer to string buffer
|
||||
push r14 ;
|
||||
ld r14, Y+ ;
|
||||
ld r15, Y+ ;/
|
||||
rcall xvprintf
|
||||
_MOVW ZH,ZL, r15,r14 ;Terminate string
|
||||
st Z, r1 ;
|
||||
pop r14 ;
|
||||
pop r15 ;/
|
||||
pop ZH ;Restore registered output function
|
||||
pop ZL ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
|
||||
#if USE_XFPRINTF
|
||||
.func __xfprintf
|
||||
.global __xfprintf
|
||||
__xfprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
lds ZL, xfunc_out+0 ;Save registered output function
|
||||
lds ZH, xfunc_out+1 ;
|
||||
push ZL ;
|
||||
push ZH ;/
|
||||
ld ZL, Y+ ;Set output function
|
||||
ld ZH, Y+ ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
rcall xvprintf
|
||||
pop ZH ;Restore registered output function
|
||||
pop ZL ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Extended numeral string input
|
||||
;
|
||||
;Prototype:
|
||||
; char xatoi ( /* 1: Successful, 0: Failed */
|
||||
; const char **str, /* pointer to pointer to source string */
|
||||
; long *res /* result */
|
||||
; );
|
||||
;
|
||||
|
||||
|
||||
#if USE_XATOI
|
||||
.func xatoi
|
||||
.global xatoi
|
||||
xatoi:
|
||||
_MOVW r1, r0, r23, r22
|
||||
_MOVW XH, XL, r25, r24
|
||||
ld ZL, X+
|
||||
ld ZH, X+
|
||||
clr r18 ;r21:r18 = 0;
|
||||
clr r19 ;
|
||||
clr r20 ;
|
||||
clr r21 ;/
|
||||
clt ;T = 0;
|
||||
|
||||
ldi r25, 10 ;r25 = 10;
|
||||
rjmp 41f ;/
|
||||
40: adiw ZL, 1 ;Z++;
|
||||
41: ld r22, Z ;r22 = *Z;
|
||||
cpi r22, ' ' ;if(r22 == ' ') continue
|
||||
breq 40b ;/
|
||||
brcs 70f ;if(r22 < ' ') error;
|
||||
cpi r22, '-' ;if(r22 == '-') {
|
||||
brne 42f ; T = 1;
|
||||
set ; continue;
|
||||
rjmp 40b ;}
|
||||
42: cpi r22, '9'+1 ;if(r22 > '9') error;
|
||||
brcc 70f ;/
|
||||
cpi r22, '0' ;if(r22 < '0') error;
|
||||
brcs 70f ;/
|
||||
brne 51f ;if(r22 > '0') cv_start;
|
||||
ldi r25, 8 ;r25 = 8;
|
||||
adiw ZL, 1 ;r22 = *(++Z);
|
||||
ld r22, Z ;/
|
||||
cpi r22, ' '+1 ;if(r22 <= ' ') exit;
|
||||
brcs 80f ;/
|
||||
cpi r22, 'b' ;if(r22 == 'b') {
|
||||
brne 43f ; r25 = 2;
|
||||
ldi r25, 2 ; cv_start;
|
||||
rjmp 50f ;}
|
||||
43: cpi r22, 'x' ;if(r22 != 'x') error;
|
||||
brne 51f ;/
|
||||
ldi r25, 16 ;r25 = 16;
|
||||
|
||||
50: adiw ZL, 1 ;Z++;
|
||||
ld r22, Z ;r22 = *Z;
|
||||
51: cpi r22, ' '+1 ;if(r22 <= ' ') break;
|
||||
brcs 80f ;/
|
||||
cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20;
|
||||
brcs 52f ;
|
||||
subi r22, 0x20 ;/
|
||||
52: subi r22, '0' ;if((r22 -= '0') < 0) error;
|
||||
brcs 70f ;/
|
||||
cpi r22, 10 ;if(r22 >= 10) {
|
||||
brcs 53f ; r22 -= 7;
|
||||
subi r22, 7 ; if(r22 < 10)
|
||||
cpi r22, 10 ;
|
||||
brcs 70f ;}
|
||||
53: cp r22, r25 ;if(r22 >= r25) error;
|
||||
brcc 70f ;/
|
||||
60: ldi r24, 33 ;r21:r18 *= r25;
|
||||
sub r23, r23 ;
|
||||
61: brcc 62f ;
|
||||
add r23, r25 ;
|
||||
62: lsr r23 ;
|
||||
ror r21 ;
|
||||
ror r20 ;
|
||||
ror r19 ;
|
||||
ror r18 ;
|
||||
dec r24 ;
|
||||
brne 61b ;/
|
||||
add r18, r22 ;r21:r18 += r22;
|
||||
adc r19, r24 ;
|
||||
adc r20, r24 ;
|
||||
adc r21, r24 ;/
|
||||
rjmp 50b ;repeat
|
||||
|
||||
70: ldi r24, 0
|
||||
rjmp 81f
|
||||
80: ldi r24, 1
|
||||
81: brtc 82f
|
||||
clr r22
|
||||
com r18
|
||||
com r19
|
||||
com r20
|
||||
com r21
|
||||
adc r18, r22
|
||||
adc r19, r22
|
||||
adc r20, r22
|
||||
adc r21, r22
|
||||
82: st -X, ZH
|
||||
st -X, ZL
|
||||
_MOVW XH, XL, r1, r0
|
||||
st X+, r18
|
||||
st X+, r19
|
||||
st X+, r20
|
||||
st X+, r21
|
||||
clr r1
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Extended itoa, puts, printf and atoi (C)ChaN, 2011
|
||||
;---------------------------------------------------------------------------;
|
||||
|
||||
// Base size is 152 bytes
|
||||
#define CR_CRLF 0 // Convert \n to \r\n (+10 bytes)
|
||||
#define USE_XPRINTF 1 // Enable xprintf function (+194 bytes)
|
||||
#define USE_XSPRINTF 0 // Add xsprintf function (+78 bytes)
|
||||
#define USE_XFPRINTF 0 // Add xfprintf function (+54 bytes)
|
||||
#define USE_XATOI 0 // Enable xatoi function (+182 bytes)
|
||||
|
||||
|
||||
#if FLASHEND > 0x1FFFF
|
||||
#error xitoa module does not support 256K devices
|
||||
#endif
|
||||
|
||||
.nolist
|
||||
#include <avr/io.h> // Include device specific definitions.
|
||||
.list
|
||||
|
||||
#ifdef SPM_PAGESIZE // Recent devices have "lpm Rd,Z+" and "movw".
|
||||
.macro _LPMI reg
|
||||
lpm \reg, Z+
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
movw \dl, \sl
|
||||
.endm
|
||||
#else // Earlier devices do not have "lpm Rd,Z+" nor "movw".
|
||||
.macro _LPMI reg
|
||||
lpm
|
||||
mov \reg, r0
|
||||
adiw ZL, 1
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
mov \dl, \sl
|
||||
mov \dh, \sh
|
||||
.endm
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Stub function to forward to user output function
|
||||
;
|
||||
;Prototype: void xputc (char chr // a character to be output
|
||||
; );
|
||||
;Size: 12/12 words
|
||||
|
||||
.section .bss
|
||||
.global xfunc_out ; xfunc_out must be initialized before using this module.
|
||||
xfunc_out: .ds.w 1
|
||||
.section .text
|
||||
|
||||
|
||||
.func xputc
|
||||
.global xputc
|
||||
xputc:
|
||||
#if CR_CRLF
|
||||
cpi r24, 10 ;LF --> CRLF
|
||||
brne 1f ;
|
||||
ldi r24, 13 ;
|
||||
rcall 1f ;
|
||||
ldi r24, 10 ;/
|
||||
1:
|
||||
#endif
|
||||
push ZH
|
||||
push ZL
|
||||
lds ZL, xfunc_out+0 ;Pointer to the registered output function.
|
||||
lds ZH, xfunc_out+1 ;/
|
||||
sbiw ZL, 0 ;Skip if null
|
||||
breq 2f ;/
|
||||
icall
|
||||
2: pop ZL
|
||||
pop ZH
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Direct ROM string output
|
||||
;
|
||||
;Prototype: void xputs (const char *str_p // rom string to be output
|
||||
; );
|
||||
|
||||
.func xputs
|
||||
.global xputs
|
||||
xputs:
|
||||
_MOVW ZH,ZL, r25,r24 ; Z = pointer to rom string
|
||||
1: _LPMI r24
|
||||
cpi r24, 0
|
||||
breq 2f
|
||||
rcall xputc
|
||||
rjmp 1b
|
||||
2: ret
|
||||
.endfunc
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Extended direct numeral string output (32bit version)
|
||||
;
|
||||
;Prototype: void xitoa (long value, // value to be output
|
||||
; char radix, // radix
|
||||
; char width); // minimum width
|
||||
;
|
||||
|
||||
.func xitoa
|
||||
.global xitoa
|
||||
xitoa:
|
||||
;r25:r22 = value, r20 = base, r18 = digits
|
||||
clr r31 ;r31 = stack level
|
||||
ldi r30, ' ' ;r30 = sign
|
||||
ldi r19, ' ' ;r19 = filler
|
||||
sbrs r20, 7 ;When base indicates signd format and the value
|
||||
rjmp 0f ;is minus, add a '-'.
|
||||
neg r20 ;
|
||||
sbrs r25, 7 ;
|
||||
rjmp 0f ;
|
||||
ldi r30, '-' ;
|
||||
com r22 ;
|
||||
com r23 ;
|
||||
com r24 ;
|
||||
com r25 ;
|
||||
adc r22, r1 ;
|
||||
adc r23, r1 ;
|
||||
adc r24, r1 ;
|
||||
adc r25, r1 ;/
|
||||
0: sbrs r18, 7 ;When digits indicates zero filled,
|
||||
rjmp 1f ;filler is '0'.
|
||||
neg r18 ;
|
||||
ldi r19, '0' ;/
|
||||
;----- string conversion loop
|
||||
1: ldi r21, 32 ;r26 = r25:r22 % r20
|
||||
clr r26 ;r25:r22 /= r20
|
||||
2: lsl r22 ;
|
||||
rol r23 ;
|
||||
rol r24 ;
|
||||
rol r25 ;
|
||||
rol r26 ;
|
||||
cp r26, r20 ;
|
||||
brcs 3f ;
|
||||
sub r26, r20 ;
|
||||
inc r22 ;
|
||||
3: dec r21 ;
|
||||
brne 2b ;/
|
||||
cpi r26, 10 ;r26 is a numeral digit '0'-'F'
|
||||
brcs 4f ;
|
||||
subi r26, -7 ;
|
||||
4: subi r26, -'0' ;/
|
||||
push r26 ;Stack it
|
||||
inc r31 ;/
|
||||
cp r22, r1 ;Repeat until r25:r22 gets zero
|
||||
cpc r23, r1 ;
|
||||
cpc r24, r1 ;
|
||||
cpc r25, r1 ;
|
||||
brne 1b ;/
|
||||
|
||||
cpi r30, '-' ;Minus sign if needed
|
||||
brne 5f ;
|
||||
push r30 ;
|
||||
inc r31 ;/
|
||||
5: cp r31, r18 ;Filler
|
||||
brcc 6f ;
|
||||
push r19 ;
|
||||
inc r31 ;
|
||||
rjmp 5b ;/
|
||||
|
||||
6: pop r24 ;Flush stacked digits and exit
|
||||
rcall xputc ;
|
||||
dec r31 ;
|
||||
brne 6b ;/
|
||||
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Formatted string output (16/32bit version)
|
||||
;
|
||||
;Prototype:
|
||||
; void __xprintf (const char *format_p, ...);
|
||||
; void __xsprintf(char*, const char *format_p, ...);
|
||||
; void __xfprintf(void(*func)(char), const char *format_p, ...);
|
||||
;
|
||||
|
||||
#if USE_XPRINTF
|
||||
|
||||
.func xvprintf
|
||||
xvprintf:
|
||||
ld ZL, Y+ ;Z = pointer to format string
|
||||
ld ZH, Y+ ;/
|
||||
|
||||
0: _LPMI r24 ;Get a format char
|
||||
cpi r24, 0 ;End of format string?
|
||||
breq 90f ;/
|
||||
cpi r24, '%' ;Is format?
|
||||
breq 20f ;/
|
||||
1: rcall xputc ;Put a normal character
|
||||
rjmp 0b ;/
|
||||
90: ret
|
||||
|
||||
20: ldi r18, 0 ;r18: digits
|
||||
clt ;T: filler
|
||||
_LPMI r21 ;Get flags
|
||||
cpi r21, '%' ;Is a %?
|
||||
breq 1b ;/
|
||||
cpi r21, '0' ;Zero filled?
|
||||
brne 23f ;
|
||||
set ;/
|
||||
22: _LPMI r21 ;Get width
|
||||
23: cpi r21, '9'+1 ;
|
||||
brcc 24f ;
|
||||
subi r21, '0' ;
|
||||
brcs 90b ;
|
||||
lsl r18 ;
|
||||
mov r0, r18 ;
|
||||
lsl r18 ;
|
||||
lsl r18 ;
|
||||
add r18, r0 ;
|
||||
add r18, r21 ;
|
||||
rjmp 22b ;/
|
||||
|
||||
24: brtc 25f ;get value (low word)
|
||||
neg r18 ;
|
||||
25: ld r24, Y+ ;
|
||||
ld r25, Y+ ;/
|
||||
cpi r21, 'c' ;Is type character?
|
||||
breq 1b ;/
|
||||
cpi r21, 's' ;Is type RAM string?
|
||||
breq 50f ;/
|
||||
cpi r21, 'S' ;Is type ROM string?
|
||||
breq 60f ;/
|
||||
_MOVW r23,r22,r25,r24 ;r25:r22 = value
|
||||
clr r24 ;
|
||||
clr r25 ;
|
||||
clt ;/
|
||||
cpi r21, 'l' ;Is long int?
|
||||
brne 26f ;
|
||||
ld r24, Y+ ;get value (high word)
|
||||
ld r25, Y+ ;
|
||||
set ;
|
||||
_LPMI r21 ;/
|
||||
26: cpi r21, 'd' ;Is type signed decimal?
|
||||
brne 27f ;/
|
||||
ldi r20, -10 ;
|
||||
brts 40f ;
|
||||
sbrs r23, 7 ;
|
||||
rjmp 40f ;
|
||||
ldi r24, -1 ;
|
||||
ldi r25, -1 ;
|
||||
rjmp 40f ;/
|
||||
27: cpi r21, 'u' ;Is type unsigned decimal?
|
||||
ldi r20, 10 ;
|
||||
breq 40f ;/
|
||||
cpi r21, 'X' ;Is type hexdecimal?
|
||||
ldi r20, 16 ;
|
||||
breq 40f ;/
|
||||
cpi r21, 'b' ;Is type binary?
|
||||
ldi r20, 2 ;
|
||||
breq 40f ;/
|
||||
ret ;abort
|
||||
40: push ZH ;Output the value
|
||||
push ZL ;
|
||||
rcall xitoa ;
|
||||
42: pop ZL ;
|
||||
pop ZH ;
|
||||
rjmp 0b ;/
|
||||
|
||||
50: push ZH ;Put a string on the RAM
|
||||
push ZL
|
||||
_MOVW ZH,ZL, r25,r24
|
||||
51: ld r24, Z+
|
||||
cpi r24, 0
|
||||
breq 42b
|
||||
rcall xputc
|
||||
rjmp 51b
|
||||
|
||||
60: push ZH ;Put a string on the ROM
|
||||
push ZL
|
||||
rcall xputs
|
||||
rjmp 42b
|
||||
.endfunc
|
||||
|
||||
|
||||
.func __xprintf
|
||||
.global __xprintf
|
||||
__xprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
rcall xvprintf
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
#if USE_XSPRINTF
|
||||
|
||||
.func __xsprintf
|
||||
putram:
|
||||
_MOVW ZH,ZL, r15,r14
|
||||
st Z+, r24
|
||||
_MOVW r15,r14, ZH,ZL
|
||||
ret
|
||||
.global __xsprintf
|
||||
__xsprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
lds ZL, xfunc_out+0 ;Save registered output function
|
||||
lds ZH, xfunc_out+1 ;
|
||||
push ZL ;
|
||||
push ZH ;/
|
||||
ldi ZL, lo8(pm(putram));Set local output function
|
||||
ldi ZH, hi8(pm(putram));
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
push r15 ;Initialize pointer to string buffer
|
||||
push r14 ;
|
||||
ld r14, Y+ ;
|
||||
ld r15, Y+ ;/
|
||||
rcall xvprintf
|
||||
_MOVW ZH,ZL, r15,r14 ;Terminate string
|
||||
st Z, r1 ;
|
||||
pop r14 ;
|
||||
pop r15 ;/
|
||||
pop ZH ;Restore registered output function
|
||||
pop ZL ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
|
||||
#if USE_XFPRINTF
|
||||
.func __xfprintf
|
||||
.global __xfprintf
|
||||
__xfprintf:
|
||||
push YH
|
||||
push YL
|
||||
in YL, _SFR_IO_ADDR(SPL)
|
||||
#ifdef SPH
|
||||
in YH, _SFR_IO_ADDR(SPH)
|
||||
#else
|
||||
clr YH
|
||||
#endif
|
||||
adiw YL, 5 ;Y = pointer to arguments
|
||||
lds ZL, xfunc_out+0 ;Save registered output function
|
||||
lds ZH, xfunc_out+1 ;
|
||||
push ZL ;
|
||||
push ZH ;/
|
||||
ld ZL, Y+ ;Set output function
|
||||
ld ZH, Y+ ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
rcall xvprintf
|
||||
pop ZH ;Restore registered output function
|
||||
pop ZL ;
|
||||
sts xfunc_out+0, ZL ;
|
||||
sts xfunc_out+1, ZH ;/
|
||||
pop YL
|
||||
pop YH
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Extended numeral string input
|
||||
;
|
||||
;Prototype:
|
||||
; char xatoi ( /* 1: Successful, 0: Failed */
|
||||
; const char **str, /* pointer to pointer to source string */
|
||||
; long *res /* result */
|
||||
; );
|
||||
;
|
||||
|
||||
|
||||
#if USE_XATOI
|
||||
.func xatoi
|
||||
.global xatoi
|
||||
xatoi:
|
||||
_MOVW r1, r0, r23, r22
|
||||
_MOVW XH, XL, r25, r24
|
||||
ld ZL, X+
|
||||
ld ZH, X+
|
||||
clr r18 ;r21:r18 = 0;
|
||||
clr r19 ;
|
||||
clr r20 ;
|
||||
clr r21 ;/
|
||||
clt ;T = 0;
|
||||
|
||||
ldi r25, 10 ;r25 = 10;
|
||||
rjmp 41f ;/
|
||||
40: adiw ZL, 1 ;Z++;
|
||||
41: ld r22, Z ;r22 = *Z;
|
||||
cpi r22, ' ' ;if(r22 == ' ') continue
|
||||
breq 40b ;/
|
||||
brcs 70f ;if(r22 < ' ') error;
|
||||
cpi r22, '-' ;if(r22 == '-') {
|
||||
brne 42f ; T = 1;
|
||||
set ; continue;
|
||||
rjmp 40b ;}
|
||||
42: cpi r22, '9'+1 ;if(r22 > '9') error;
|
||||
brcc 70f ;/
|
||||
cpi r22, '0' ;if(r22 < '0') error;
|
||||
brcs 70f ;/
|
||||
brne 51f ;if(r22 > '0') cv_start;
|
||||
ldi r25, 8 ;r25 = 8;
|
||||
adiw ZL, 1 ;r22 = *(++Z);
|
||||
ld r22, Z ;/
|
||||
cpi r22, ' '+1 ;if(r22 <= ' ') exit;
|
||||
brcs 80f ;/
|
||||
cpi r22, 'b' ;if(r22 == 'b') {
|
||||
brne 43f ; r25 = 2;
|
||||
ldi r25, 2 ; cv_start;
|
||||
rjmp 50f ;}
|
||||
43: cpi r22, 'x' ;if(r22 != 'x') error;
|
||||
brne 51f ;/
|
||||
ldi r25, 16 ;r25 = 16;
|
||||
|
||||
50: adiw ZL, 1 ;Z++;
|
||||
ld r22, Z ;r22 = *Z;
|
||||
51: cpi r22, ' '+1 ;if(r22 <= ' ') break;
|
||||
brcs 80f ;/
|
||||
cpi r22, 'a' ;if(r22 >= 'a') r22 =- 0x20;
|
||||
brcs 52f ;
|
||||
subi r22, 0x20 ;/
|
||||
52: subi r22, '0' ;if((r22 -= '0') < 0) error;
|
||||
brcs 70f ;/
|
||||
cpi r22, 10 ;if(r22 >= 10) {
|
||||
brcs 53f ; r22 -= 7;
|
||||
subi r22, 7 ; if(r22 < 10)
|
||||
cpi r22, 10 ;
|
||||
brcs 70f ;}
|
||||
53: cp r22, r25 ;if(r22 >= r25) error;
|
||||
brcc 70f ;/
|
||||
60: ldi r24, 33 ;r21:r18 *= r25;
|
||||
sub r23, r23 ;
|
||||
61: brcc 62f ;
|
||||
add r23, r25 ;
|
||||
62: lsr r23 ;
|
||||
ror r21 ;
|
||||
ror r20 ;
|
||||
ror r19 ;
|
||||
ror r18 ;
|
||||
dec r24 ;
|
||||
brne 61b ;/
|
||||
add r18, r22 ;r21:r18 += r22;
|
||||
adc r19, r24 ;
|
||||
adc r20, r24 ;
|
||||
adc r21, r24 ;/
|
||||
rjmp 50b ;repeat
|
||||
|
||||
70: ldi r24, 0
|
||||
rjmp 81f
|
||||
80: ldi r24, 1
|
||||
81: brtc 82f
|
||||
clr r22
|
||||
com r18
|
||||
com r19
|
||||
com r20
|
||||
com r21
|
||||
adc r18, r22
|
||||
adc r19, r22
|
||||
adc r20, r22
|
||||
adc r21, r22
|
||||
82: st -X, ZH
|
||||
st -X, ZL
|
||||
_MOVW XH, XL, r1, r0
|
||||
st X+, r18
|
||||
st X+, r19
|
||||
st X+, r20
|
||||
st X+, r21
|
||||
clr r1
|
||||
ret
|
||||
.endfunc
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,111 +1,111 @@
|
||||
/*---------------------------------------------------------------------------
|
||||
Extended itoa, puts and printf (C)ChaN, 2011
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef XPRINTF_H
|
||||
#define XPRINTF_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void (*xfunc_out)(uint8_t);
|
||||
#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)
|
||||
|
||||
/* This is a pointer to user defined output function. It must be initialized
|
||||
before using this modle.
|
||||
*/
|
||||
|
||||
void xputc(char chr);
|
||||
|
||||
/* This is a stub function to forward outputs to user defined output function.
|
||||
All outputs from this module are output via this function.
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void xputs(const char *string_p);
|
||||
|
||||
/* The string placed in the ROM is forwarded to xputc() directly.
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void xitoa(long value, char radix, char width);
|
||||
|
||||
/* Extended itoa().
|
||||
|
||||
value radix width output
|
||||
100 10 6 " 100"
|
||||
100 10 -6 "000100"
|
||||
100 10 0 "100"
|
||||
4294967295 10 0 "4294967295"
|
||||
4294967295 -10 0 "-1"
|
||||
655360 16 -8 "000A0000"
|
||||
1024 16 0 "400"
|
||||
0x55 2 -8 "01010101"
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__)
|
||||
#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__)
|
||||
#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__)
|
||||
|
||||
void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */
|
||||
void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */
|
||||
void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */
|
||||
|
||||
/* Format string is placed in the ROM. The format flags is similar to printf().
|
||||
|
||||
%[flag][width][size]type
|
||||
|
||||
flag
|
||||
A '0' means filled with '0' when output is shorter than width.
|
||||
' ' is used in default. This is effective only numeral type.
|
||||
width
|
||||
Minimum width in decimal number. This is effective only numeral type.
|
||||
Default width is zero.
|
||||
size
|
||||
A 'l' means the argument is long(32bit). Default is short(16bit).
|
||||
This is effective only numeral type.
|
||||
type
|
||||
'c' : Character, argument is the value
|
||||
's' : String placed on the RAM, argument is the pointer
|
||||
'S' : String placed on the ROM, argument is the pointer
|
||||
'd' : Signed decimal, argument is the value
|
||||
'u' : Unsigned decimal, argument is the value
|
||||
'X' : Hexdecimal, argument is the value
|
||||
'b' : Binary, argument is the value
|
||||
'%' : '%'
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
char xatoi(char **str, long *ret);
|
||||
|
||||
/* Get value of the numeral string.
|
||||
|
||||
str
|
||||
Pointer to pointer to source string
|
||||
|
||||
"0b11001010" binary
|
||||
"0377" octal
|
||||
"0xff800" hexdecimal
|
||||
"1250000" decimal
|
||||
"-25000" decimal
|
||||
|
||||
ret
|
||||
Pointer to return value
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Extended itoa, puts and printf (C)ChaN, 2011
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef XPRINTF_H
|
||||
#define XPRINTF_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void (*xfunc_out)(uint8_t);
|
||||
#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)
|
||||
|
||||
/* This is a pointer to user defined output function. It must be initialized
|
||||
before using this modle.
|
||||
*/
|
||||
|
||||
void xputc(char chr);
|
||||
|
||||
/* This is a stub function to forward outputs to user defined output function.
|
||||
All outputs from this module are output via this function.
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void xputs(const char *string_p);
|
||||
|
||||
/* The string placed in the ROM is forwarded to xputc() directly.
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void xitoa(long value, char radix, char width);
|
||||
|
||||
/* Extended itoa().
|
||||
|
||||
value radix width output
|
||||
100 10 6 " 100"
|
||||
100 10 -6 "000100"
|
||||
100 10 0 "100"
|
||||
4294967295 10 0 "4294967295"
|
||||
4294967295 -10 0 "-1"
|
||||
655360 16 -8 "000A0000"
|
||||
1024 16 0 "400"
|
||||
0x55 2 -8 "01010101"
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
#define xprintf(format, ...) __xprintf(PSTR(format), ##__VA_ARGS__)
|
||||
#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__)
|
||||
#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__)
|
||||
|
||||
void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */
|
||||
void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */
|
||||
void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */
|
||||
|
||||
/* Format string is placed in the ROM. The format flags is similar to printf().
|
||||
|
||||
%[flag][width][size]type
|
||||
|
||||
flag
|
||||
A '0' means filled with '0' when output is shorter than width.
|
||||
' ' is used in default. This is effective only numeral type.
|
||||
width
|
||||
Minimum width in decimal number. This is effective only numeral type.
|
||||
Default width is zero.
|
||||
size
|
||||
A 'l' means the argument is long(32bit). Default is short(16bit).
|
||||
This is effective only numeral type.
|
||||
type
|
||||
'c' : Character, argument is the value
|
||||
's' : String placed on the RAM, argument is the pointer
|
||||
'S' : String placed on the ROM, argument is the pointer
|
||||
'd' : Signed decimal, argument is the value
|
||||
'u' : Unsigned decimal, argument is the value
|
||||
'X' : Hexdecimal, argument is the value
|
||||
'b' : Binary, argument is the value
|
||||
'%' : '%'
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
char xatoi(char **str, long *ret);
|
||||
|
||||
/* Get value of the numeral string.
|
||||
|
||||
str
|
||||
Pointer to pointer to source string
|
||||
|
||||
"0b11001010" binary
|
||||
"0377" octal
|
||||
"0xff800" hexdecimal
|
||||
"1250000" decimal
|
||||
"-25000" decimal
|
||||
|
||||
ret
|
||||
Pointer to return value
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
CC = gcc
|
||||
OBJCOPY =
|
||||
OBJDUMP =
|
||||
SIZE =
|
||||
AR =
|
||||
NM =
|
||||
HEX =
|
||||
EEP =
|
||||
BIN =
|
||||
|
||||
|
||||
COMPILEFLAGS += -funsigned-char
|
||||
COMPILEFLAGS += -funsigned-bitfields
|
||||
COMPILEFLAGS += -ffunction-sections
|
||||
COMPILEFLAGS += -fdata-sections
|
||||
COMPILEFLAGS += -fshort-enums
|
||||
|
||||
CFLAGS += $(COMPILEFLAGS)
|
||||
CFLAGS += -fno-inline-small-functions
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
|
||||
CPPFLAGS += $(COMPILEFLAGS)
|
||||
CPPFLAGS += -fno-exceptions
|
||||
CPPFLAGS += -std=gnu++11
|
@ -1,156 +1,156 @@
|
||||
;---------------------------------------------------------------------------;
|
||||
; Software implemented UART module ;
|
||||
; (C)ChaN, 2005 (http://elm-chan.org/) ;
|
||||
;---------------------------------------------------------------------------;
|
||||
; Bit rate settings:
|
||||
;
|
||||
; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz
|
||||
; 2.4kbps 138 - - - - - - - -
|
||||
; 4.8kbps 68 138 - - - - - - -
|
||||
; 9.6kbps 33 68 138 208 - - - - -
|
||||
; 19.2kbps - 33 68 102 138 173 208 - -
|
||||
; 38.4kbps - - 33 50 68 85 102 138 172
|
||||
; 57.6kbps - - 21 33 44 56 68 91 114
|
||||
; 115.2kbps - - - - 21 27 33 44 56
|
||||
|
||||
.nolist
|
||||
#include <avr/io.h>
|
||||
.list
|
||||
|
||||
#define BPS 102 /* Bit delay. (see above table) */
|
||||
#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */
|
||||
|
||||
#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */
|
||||
#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */
|
||||
#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */
|
||||
#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */
|
||||
|
||||
|
||||
|
||||
#ifdef SPM_PAGESIZE
|
||||
.macro _LPMI reg
|
||||
lpm \reg, Z+
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
movw \dl, \sl
|
||||
.endm
|
||||
#else
|
||||
.macro _LPMI reg
|
||||
lpm
|
||||
mov \reg, r0
|
||||
adiw ZL, 1
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
mov \dl, \sl
|
||||
mov \dh, \sh
|
||||
.endm
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Transmit a byte in serial format of N81
|
||||
;
|
||||
;Prototype: void xmit (uint8_t data);
|
||||
;Size: 16 words
|
||||
|
||||
.global xmit
|
||||
.func xmit
|
||||
xmit:
|
||||
#if BIDIR
|
||||
ldi r23, BPS-1 ;Pre-idle time for bidirectional data line
|
||||
5: dec r23 ;
|
||||
brne 5b ;/
|
||||
#endif
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
com r24 ;C = start bit
|
||||
ldi r25, 10 ;Bit counter
|
||||
cli ;Start critical section
|
||||
|
||||
1: ldi r23, BPS-1 ;----- Bit transferring loop
|
||||
2: dec r23 ;Wait for a bit time
|
||||
brne 2b ;/
|
||||
brcs 3f ;MISO = bit to be sent
|
||||
OUT_1 ;
|
||||
3: brcc 4f ;
|
||||
OUT_0 ;/
|
||||
4: lsr r24 ;Get next bit into C
|
||||
dec r25 ;All bits sent?
|
||||
brne 1b ; no, coutinue
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Receive a byte
|
||||
;
|
||||
;Prototype: uint8_t rcvr (void);
|
||||
;Size: 19 words
|
||||
|
||||
.global rcvr
|
||||
.func rcvr
|
||||
rcvr:
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
ldi r24, 0x80 ;Receiving shift reg
|
||||
cli ;Start critical section
|
||||
|
||||
1: SKIP_IN_1 ;Wait for idle
|
||||
rjmp 1b
|
||||
2: SKIP_IN_0 ;Wait for start bit
|
||||
rjmp 2b
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
3: dec r25
|
||||
brne 3b
|
||||
|
||||
4: ldi r25, BPS ;----- Bit receiving loop
|
||||
5: dec r25 ;Wait for a bit time
|
||||
brne 5b ;/
|
||||
lsr r24 ;Next bit
|
||||
SKIP_IN_0 ;Get a data bit into r24.7
|
||||
ori r24, 0x80
|
||||
brcc 4b ;All bits received? no, continue
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
; Not wait for start bit. This should be called after detecting start bit.
|
||||
.global recv
|
||||
.func recv
|
||||
recv:
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
ldi r24, 0x80 ;Receiving shift reg
|
||||
cli ;Start critical section
|
||||
|
||||
;1: SKIP_IN_1 ;Wait for idle
|
||||
; rjmp 1b
|
||||
;2: SKIP_IN_0 ;Wait for start bit
|
||||
; rjmp 2b
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
3: dec r25
|
||||
brne 3b
|
||||
|
||||
4: ldi r25, BPS ;----- Bit receiving loop
|
||||
5: dec r25 ;Wait for a bit time
|
||||
brne 5b ;/
|
||||
lsr r24 ;Next bit
|
||||
SKIP_IN_0 ;Get a data bit into r24.7
|
||||
ori r24, 0x80
|
||||
brcc 4b ;All bits received? no, continue
|
||||
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
6: dec r25
|
||||
brne 6b
|
||||
7: SKIP_IN_1 ;Wait for stop bit
|
||||
rjmp 7b
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
;---------------------------------------------------------------------------;
|
||||
; Software implemented UART module ;
|
||||
; (C)ChaN, 2005 (http://elm-chan.org/) ;
|
||||
;---------------------------------------------------------------------------;
|
||||
; Bit rate settings:
|
||||
;
|
||||
; 1MHz 2MHz 4MHz 6MHz 8MHz 10MHz 12MHz 16MHz 20MHz
|
||||
; 2.4kbps 138 - - - - - - - -
|
||||
; 4.8kbps 68 138 - - - - - - -
|
||||
; 9.6kbps 33 68 138 208 - - - - -
|
||||
; 19.2kbps - 33 68 102 138 173 208 - -
|
||||
; 38.4kbps - - 33 50 68 85 102 138 172
|
||||
; 57.6kbps - - 21 33 44 56 68 91 114
|
||||
; 115.2kbps - - - - 21 27 33 44 56
|
||||
|
||||
.nolist
|
||||
#include <avr/io.h>
|
||||
.list
|
||||
|
||||
#define BPS 102 /* Bit delay. (see above table) */
|
||||
#define BIDIR 0 /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */
|
||||
|
||||
#define OUT_1 sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */
|
||||
#define OUT_0 cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */
|
||||
#define SKIP_IN_1 sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 1 */
|
||||
#define SKIP_IN_0 sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT /* Skip if 0 */
|
||||
|
||||
|
||||
|
||||
#ifdef SPM_PAGESIZE
|
||||
.macro _LPMI reg
|
||||
lpm \reg, Z+
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
movw \dl, \sl
|
||||
.endm
|
||||
#else
|
||||
.macro _LPMI reg
|
||||
lpm
|
||||
mov \reg, r0
|
||||
adiw ZL, 1
|
||||
.endm
|
||||
.macro _MOVW dh,dl, sh,sl
|
||||
mov \dl, \sl
|
||||
mov \dh, \sh
|
||||
.endm
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Transmit a byte in serial format of N81
|
||||
;
|
||||
;Prototype: void xmit (uint8_t data);
|
||||
;Size: 16 words
|
||||
|
||||
.global xmit
|
||||
.func xmit
|
||||
xmit:
|
||||
#if BIDIR
|
||||
ldi r23, BPS-1 ;Pre-idle time for bidirectional data line
|
||||
5: dec r23 ;
|
||||
brne 5b ;/
|
||||
#endif
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
com r24 ;C = start bit
|
||||
ldi r25, 10 ;Bit counter
|
||||
cli ;Start critical section
|
||||
|
||||
1: ldi r23, BPS-1 ;----- Bit transferring loop
|
||||
2: dec r23 ;Wait for a bit time
|
||||
brne 2b ;/
|
||||
brcs 3f ;MISO = bit to be sent
|
||||
OUT_1 ;
|
||||
3: brcc 4f ;
|
||||
OUT_0 ;/
|
||||
4: lsr r24 ;Get next bit into C
|
||||
dec r25 ;All bits sent?
|
||||
brne 1b ; no, coutinue
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------;
|
||||
; Receive a byte
|
||||
;
|
||||
;Prototype: uint8_t rcvr (void);
|
||||
;Size: 19 words
|
||||
|
||||
.global rcvr
|
||||
.func rcvr
|
||||
rcvr:
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
ldi r24, 0x80 ;Receiving shift reg
|
||||
cli ;Start critical section
|
||||
|
||||
1: SKIP_IN_1 ;Wait for idle
|
||||
rjmp 1b
|
||||
2: SKIP_IN_0 ;Wait for start bit
|
||||
rjmp 2b
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
3: dec r25
|
||||
brne 3b
|
||||
|
||||
4: ldi r25, BPS ;----- Bit receiving loop
|
||||
5: dec r25 ;Wait for a bit time
|
||||
brne 5b ;/
|
||||
lsr r24 ;Next bit
|
||||
SKIP_IN_0 ;Get a data bit into r24.7
|
||||
ori r24, 0x80
|
||||
brcc 4b ;All bits received? no, continue
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
|
||||
|
||||
; Not wait for start bit. This should be called after detecting start bit.
|
||||
.global recv
|
||||
.func recv
|
||||
recv:
|
||||
in r0, _SFR_IO_ADDR(SREG) ;Save flags
|
||||
|
||||
ldi r24, 0x80 ;Receiving shift reg
|
||||
cli ;Start critical section
|
||||
|
||||
;1: SKIP_IN_1 ;Wait for idle
|
||||
; rjmp 1b
|
||||
;2: SKIP_IN_0 ;Wait for start bit
|
||||
; rjmp 2b
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
3: dec r25
|
||||
brne 3b
|
||||
|
||||
4: ldi r25, BPS ;----- Bit receiving loop
|
||||
5: dec r25 ;Wait for a bit time
|
||||
brne 5b ;/
|
||||
lsr r24 ;Next bit
|
||||
SKIP_IN_0 ;Get a data bit into r24.7
|
||||
ori r24, 0x80
|
||||
brcc 4b ;All bits received? no, continue
|
||||
|
||||
ldi r25, BPS/2 ;Wait for half bit time
|
||||
6: dec r25
|
||||
brne 6b
|
||||
7: SKIP_IN_1 ;Wait for stop bit
|
||||
rjmp 7b
|
||||
|
||||
out _SFR_IO_ADDR(SREG), r0 ;End of critical section
|
||||
ret
|
||||
.endfunc
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef SUART
|
||||
#define SUART
|
||||
|
||||
void xmit(uint8_t);
|
||||
uint8_t rcvr(void);
|
||||
uint8_t recv(void);
|
||||
|
||||
#endif /* SUART */
|
||||
#ifndef SUART
|
||||
#define SUART
|
||||
|
||||
void xmit(uint8_t);
|
||||
uint8_t rcvr(void);
|
||||
uint8_t recv(void);
|
||||
|
||||
#endif /* SUART */
|
||||
|
@ -1,159 +1,159 @@
|
||||
/* This is from http://www.mtcnet.net/~henryvm/wdt/ */
|
||||
#ifndef _AVR_WD_H_
|
||||
#define _AVR_WD_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/*
|
||||
Copyright (c) 2009, Curt Van Maanen
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
include usage-
|
||||
#include "wd.h" //if in same directory as project
|
||||
#include <avr/wd.h> //if wd.h is in avr directory
|
||||
|
||||
set watchdog modes and prescale
|
||||
|
||||
usage-
|
||||
WD_SET(mode,[timeout]); //prescale always set
|
||||
|
||||
modes-
|
||||
WD_OFF disabled
|
||||
WD_RST normal reset mode
|
||||
WD_IRQ interrupt only mode (if supported)
|
||||
WD_RST_IRQ interrupt+reset mode (if supported)
|
||||
|
||||
timeout-
|
||||
WDTO_15MS default if no timeout provided
|
||||
WDTO_30MS
|
||||
WDTO_60MS
|
||||
WDTO_120MS
|
||||
WDTO_250MS
|
||||
WDTO_500MS
|
||||
WDTO_1S
|
||||
WDTO_2S
|
||||
WDTO_4S (if supported)
|
||||
WDTO_8S (if supported)
|
||||
|
||||
examples-
|
||||
WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout
|
||||
WD_SET(WD_OFF); //watchdog disabled (if not fused on)
|
||||
WD_SET(WD_RST); //reset mode, 15ms (default timeout)
|
||||
WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout
|
||||
WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout
|
||||
|
||||
|
||||
for enhanced watchdogs, if the watchdog is not being used WDRF should be
|
||||
cleared on every power up or reset, along with disabling the watchdog-
|
||||
WD_DISABLE(); //clear WDRF, then turn off watchdog
|
||||
|
||||
*/
|
||||
|
||||
//reset registers to the same name (MCUCSR)
|
||||
#if !defined(MCUCSR)
|
||||
#define MCUCSR MCUSR
|
||||
#endif
|
||||
|
||||
//watchdog registers to the same name (WDTCSR)
|
||||
#if !defined(WDTCSR)
|
||||
#define WDTCSR WDTCR
|
||||
#endif
|
||||
|
||||
//if enhanced watchdog, define irq values, create disable macro
|
||||
#if defined(WDIF)
|
||||
#define WD_IRQ 0xC0
|
||||
#define WD_RST_IRQ 0xC8
|
||||
#define WD_DISABLE() do{ \
|
||||
MCUCSR &= ~(1<<WDRF); \
|
||||
WD_SET(WD_OFF); \
|
||||
}while(0)
|
||||
#endif
|
||||
|
||||
//all watchdogs
|
||||
#define WD_RST 8
|
||||
#define WD_OFF 0
|
||||
|
||||
//prescale values
|
||||
#define WDTO_15MS 0
|
||||
#define WDTO_30MS 1
|
||||
#define WDTO_60MS 2
|
||||
#define WDTO_120MS 3
|
||||
#define WDTO_250MS 4
|
||||
#define WDTO_500MS 5
|
||||
#define WDTO_1S 6
|
||||
#define WDTO_2S 7
|
||||
|
||||
//prescale values for avrs with WDP3
|
||||
#if defined(WDP3)
|
||||
#define WDTO_4S 0x20
|
||||
#define WDTO_8S 0x21
|
||||
#endif
|
||||
|
||||
//watchdog reset
|
||||
#define WDR() __asm__ __volatile__("wdr")
|
||||
|
||||
//avr reset using watchdog
|
||||
#define WD_AVR_RESET() do{ \
|
||||
__asm__ __volatile__("cli"); \
|
||||
WD_SET_UNSAFE(WD_RST); \
|
||||
while(1); \
|
||||
}while(0)
|
||||
|
||||
/*set the watchdog-
|
||||
1. save SREG
|
||||
2. turn off irq's
|
||||
3. reset watchdog timer
|
||||
4. enable watchdog change
|
||||
5. write watchdog value
|
||||
6. restore SREG (restoring irq status)
|
||||
*/
|
||||
#define WD_SET(val,...) \
|
||||
__asm__ __volatile__( \
|
||||
"in __tmp_reg__,__SREG__" "\n\t" \
|
||||
"cli" "\n\t" \
|
||||
"wdr" "\n\t" \
|
||||
"sts %[wdreg],%[wden]" "\n\t" \
|
||||
"sts %[wdreg],%[wdval]" "\n\t" \
|
||||
"out __SREG__,__tmp_reg__" "\n\t" \
|
||||
: \
|
||||
: [wdreg] "M" (&WDTCSR), \
|
||||
[wden] "r" ((uint8_t)(0x18)), \
|
||||
[wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0))) \
|
||||
: "r0" \
|
||||
)
|
||||
|
||||
/*set the watchdog when I bit in SREG known to be clear-
|
||||
1. reset watchdog timer
|
||||
2. enable watchdog change
|
||||
5. write watchdog value
|
||||
*/
|
||||
#define WD_SET_UNSAFE(val,...) \
|
||||
__asm__ __volatile__( \
|
||||
"wdr" "\n\t" \
|
||||
"sts %[wdreg],%[wden]" "\n\t" \
|
||||
"sts %[wdreg],%[wdval]" "\n\t" \
|
||||
: \
|
||||
: [wdreg] "M" (&WDTCSR), \
|
||||
[wden] "r" ((uint8_t)(0x18)), \
|
||||
[wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0))) \
|
||||
)
|
||||
|
||||
|
||||
//for compatibility with avr/wdt.h
|
||||
#define wdt_enable(val) WD_SET(WD_RST,val)
|
||||
#define wdt_disable() WD_SET(WD_OFF)
|
||||
|
||||
|
||||
#endif /* _AVR_WD_H_ */
|
||||
/* This is from http://www.mtcnet.net/~henryvm/wdt/ */
|
||||
#ifndef _AVR_WD_H_
|
||||
#define _AVR_WD_H_
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/*
|
||||
Copyright (c) 2009, Curt Van Maanen
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
include usage-
|
||||
#include "wd.h" //if in same directory as project
|
||||
#include <avr/wd.h> //if wd.h is in avr directory
|
||||
|
||||
set watchdog modes and prescale
|
||||
|
||||
usage-
|
||||
WD_SET(mode,[timeout]); //prescale always set
|
||||
|
||||
modes-
|
||||
WD_OFF disabled
|
||||
WD_RST normal reset mode
|
||||
WD_IRQ interrupt only mode (if supported)
|
||||
WD_RST_IRQ interrupt+reset mode (if supported)
|
||||
|
||||
timeout-
|
||||
WDTO_15MS default if no timeout provided
|
||||
WDTO_30MS
|
||||
WDTO_60MS
|
||||
WDTO_120MS
|
||||
WDTO_250MS
|
||||
WDTO_500MS
|
||||
WDTO_1S
|
||||
WDTO_2S
|
||||
WDTO_4S (if supported)
|
||||
WDTO_8S (if supported)
|
||||
|
||||
examples-
|
||||
WD_SET(WD_RST,WDTO_1S); //reset mode, 1s timeout
|
||||
WD_SET(WD_OFF); //watchdog disabled (if not fused on)
|
||||
WD_SET(WD_RST); //reset mode, 15ms (default timeout)
|
||||
WD_SET(WD_IRQ,WDTO_120MS); //interrupt only mode, 120ms timeout
|
||||
WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout
|
||||
|
||||
|
||||
for enhanced watchdogs, if the watchdog is not being used WDRF should be
|
||||
cleared on every power up or reset, along with disabling the watchdog-
|
||||
WD_DISABLE(); //clear WDRF, then turn off watchdog
|
||||
|
||||
*/
|
||||
|
||||
//reset registers to the same name (MCUCSR)
|
||||
#if !defined(MCUCSR)
|
||||
#define MCUCSR MCUSR
|
||||
#endif
|
||||
|
||||
//watchdog registers to the same name (WDTCSR)
|
||||
#if !defined(WDTCSR)
|
||||
#define WDTCSR WDTCR
|
||||
#endif
|
||||
|
||||
//if enhanced watchdog, define irq values, create disable macro
|
||||
#if defined(WDIF)
|
||||
#define WD_IRQ 0xC0
|
||||
#define WD_RST_IRQ 0xC8
|
||||
#define WD_DISABLE() do{ \
|
||||
MCUCSR &= ~(1<<WDRF); \
|
||||
WD_SET(WD_OFF); \
|
||||
}while(0)
|
||||
#endif
|
||||
|
||||
//all watchdogs
|
||||
#define WD_RST 8
|
||||
#define WD_OFF 0
|
||||
|
||||
//prescale values
|
||||
#define WDTO_15MS 0
|
||||
#define WDTO_30MS 1
|
||||
#define WDTO_60MS 2
|
||||
#define WDTO_120MS 3
|
||||
#define WDTO_250MS 4
|
||||
#define WDTO_500MS 5
|
||||
#define WDTO_1S 6
|
||||
#define WDTO_2S 7
|
||||
|
||||
//prescale values for avrs with WDP3
|
||||
#if defined(WDP3)
|
||||
#define WDTO_4S 0x20
|
||||
#define WDTO_8S 0x21
|
||||
#endif
|
||||
|
||||
//watchdog reset
|
||||
#define WDR() __asm__ __volatile__("wdr")
|
||||
|
||||
//avr reset using watchdog
|
||||
#define WD_AVR_RESET() do{ \
|
||||
__asm__ __volatile__("cli"); \
|
||||
WD_SET_UNSAFE(WD_RST); \
|
||||
while(1); \
|
||||
}while(0)
|
||||
|
||||
/*set the watchdog-
|
||||
1. save SREG
|
||||
2. turn off irq's
|
||||
3. reset watchdog timer
|
||||
4. enable watchdog change
|
||||
5. write watchdog value
|
||||
6. restore SREG (restoring irq status)
|
||||
*/
|
||||
#define WD_SET(val,...) \
|
||||
__asm__ __volatile__( \
|
||||
"in __tmp_reg__,__SREG__" "\n\t" \
|
||||
"cli" "\n\t" \
|
||||
"wdr" "\n\t" \
|
||||
"sts %[wdreg],%[wden]" "\n\t" \
|
||||
"sts %[wdreg],%[wdval]" "\n\t" \
|
||||
"out __SREG__,__tmp_reg__" "\n\t" \
|
||||
: \
|
||||
: [wdreg] "M" (&WDTCSR), \
|
||||
[wden] "r" ((uint8_t)(0x18)), \
|
||||
[wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0))) \
|
||||
: "r0" \
|
||||
)
|
||||
|
||||
/*set the watchdog when I bit in SREG known to be clear-
|
||||
1. reset watchdog timer
|
||||
2. enable watchdog change
|
||||
5. write watchdog value
|
||||
*/
|
||||
#define WD_SET_UNSAFE(val,...) \
|
||||
__asm__ __volatile__( \
|
||||
"wdr" "\n\t" \
|
||||
"sts %[wdreg],%[wden]" "\n\t" \
|
||||
"sts %[wdreg],%[wdval]" "\n\t" \
|
||||
: \
|
||||
: [wdreg] "M" (&WDTCSR), \
|
||||
[wden] "r" ((uint8_t)(0x18)), \
|
||||
[wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0))) \
|
||||
)
|
||||
|
||||
|
||||
//for compatibility with avr/wdt.h
|
||||
#define wdt_enable(val) WD_SET(WD_RST,val)
|
||||
#define wdt_disable() WD_SET(WD_OFF)
|
||||
|
||||
|
||||
#endif /* _AVR_WD_H_ */
|
||||
|
@ -1,161 +1,161 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="CDC Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.128_4" force-caption="true" workspace-name="lufa_cdc_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.64_4" force-caption="true" workspace-name="lufa_cdc_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.32_4" force-caption="true" workspace-name="lufa_cdc_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.16_4" force-caption="true" workspace-name="lufa_cdc_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.8_4" force-caption="true" workspace-name="lufa_cdc_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.cdc" caption="CDC Bootloader">
|
||||
<info type="description" value="summary">
|
||||
CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderCDC.c"/>
|
||||
<build type="header-file" value="BootloaderCDC.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderCDC.txt"/>
|
||||
<build type="distribute" subtype="user-file" value="LUFA CDC Bootloader.inf"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="CDC Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.128_4" force-caption="true" workspace-name="lufa_cdc_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.64_4" force-caption="true" workspace-name="lufa_cdc_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.32_4" force-caption="true" workspace-name="lufa_cdc_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.16_4" force-caption="true" workspace-name="lufa_cdc_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="CDC Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.8_4" force-caption="true" workspace-name="lufa_cdc_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.cdc" caption="CDC Bootloader">
|
||||
<info type="description" value="summary">
|
||||
CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderCDC.c"/>
|
||||
<build type="header-file" value="BootloaderCDC.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderCDC.txt"/>
|
||||
<build type="distribute" subtype="user-file" value="LUFA CDC Bootloader.inf"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,156 +1,156 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="DFU Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.128_4" force-caption="true" workspace-name="lufa_dfu_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.64_4" force-caption="true" workspace-name="lufa_dfu_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.32_4" force-caption="true" workspace-name="lufa_dfu_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.16_4" force-caption="true" workspace-name="lufa_dfu_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.8_4" force-caption="true" workspace-name="lufa_dfu_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.dfu" caption="DFU Bootloader">
|
||||
<info type="description" value="summary">
|
||||
DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderDFU.c"/>
|
||||
<build type="header-file" value="BootloaderDFU.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderDFU.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="DFU Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.128_4" force-caption="true" workspace-name="lufa_dfu_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.64_4" force-caption="true" workspace-name="lufa_dfu_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.32_4" force-caption="true" workspace-name="lufa_dfu_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.16_4" force-caption="true" workspace-name="lufa_dfu_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="DFU Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.8_4" force-caption="true" workspace-name="lufa_dfu_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.dfu"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.dfu" caption="DFU Bootloader">
|
||||
<info type="description" value="summary">
|
||||
DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderDFU.c"/>
|
||||
<build type="header-file" value="BootloaderDFU.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderDFU.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,123 +1,123 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="HID Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.128_4" force-caption="true" workspace-name="lufa_hid_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.64_4" force-caption="true" workspace-name="lufa_hid_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.32_4" force-caption="true" workspace-name="lufa_hid_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 16KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.16_2" force-caption="true" workspace-name="lufa_hid_16kb_2kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3800"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 8KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.8_2" force-caption="true" workspace-name="lufa_hid_8kb_2kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1800"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.hid" caption="HID Bootloader">
|
||||
<info type="description" value="summary">
|
||||
HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderHID.c"/>
|
||||
<build type="header-file" value="BootloaderHID.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderHID.txt"/>
|
||||
<build type="distribute" subtype="directory" value="HostLoaderApp"/>
|
||||
<build type="distribute" subtype="directory" value="HostLoaderApp_Python"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="HID Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.128_4" force-caption="true" workspace-name="lufa_hid_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.64_4" force-caption="true" workspace-name="lufa_hid_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.32_4" force-caption="true" workspace-name="lufa_hid_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 16KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.16_2" force-caption="true" workspace-name="lufa_hid_16kb_2kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3800"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>
|
||||
</project>
|
||||
|
||||
<project caption="HID Bootloader - 8KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.8_2" force-caption="true" workspace-name="lufa_hid_8kb_2kb_">
|
||||
<require idref="lufa.bootloaders.hid"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1800"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.hid" caption="HID Bootloader">
|
||||
<info type="description" value="summary">
|
||||
HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderHID.c"/>
|
||||
<build type="header-file" value="BootloaderHID.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderHID.txt"/>
|
||||
<build type="distribute" subtype="directory" value="HostLoaderApp"/>
|
||||
<build type="distribute" subtype="directory" value="HostLoaderApp_Python"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,102 +1,102 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2014.
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that the copyright notice and this
|
||||
permission notice and warranty disclaimer appear in supporting
|
||||
documentation, and that the name of the author not be used in
|
||||
advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
The author disclaims all warranties with regard to this
|
||||
software, including all implied warranties of merchantability
|
||||
and fitness. In no event shall the author be liable for any
|
||||
special, indirect or consequential damages or any damages
|
||||
whatsoever resulting from loss of use, data or profits, whether
|
||||
in an action of contract, negligence or other tortious action,
|
||||
arising out of or in connection with the use or performance of
|
||||
this software.
|
||||
*/
|
||||
|
||||
#if AUX_BOOT_SECTION_SIZE > 0
|
||||
#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation).
|
||||
|
||||
; Trampoline to jump over the AUX bootloader section to the start of the bootloader,
|
||||
; on devices where an AUX bootloader section is used.
|
||||
.section .boot_aux_trampoline, "ax"
|
||||
.global Boot_AUX_Trampoline
|
||||
Boot_AUX_Trampoline:
|
||||
jmp BOOT_START_ADDR
|
||||
#endif
|
||||
|
||||
; Trampolines to actual API implementations if the target address is outside the
|
||||
; range of a rjmp instruction (can happen with large bootloader sections)
|
||||
.section .apitable_trampolines, "ax"
|
||||
.global BootloaderAPI_Trampolines
|
||||
BootloaderAPI_Trampolines:
|
||||
|
||||
BootloaderAPI_ErasePage_Trampoline:
|
||||
jmp BootloaderAPI_ErasePage
|
||||
BootloaderAPI_WritePage_Trampoline:
|
||||
jmp BootloaderAPI_WritePage
|
||||
BootloaderAPI_FillWord_Trampoline:
|
||||
jmp BootloaderAPI_FillWord
|
||||
BootloaderAPI_ReadSignature_Trampoline:
|
||||
jmp BootloaderAPI_ReadSignature
|
||||
BootloaderAPI_ReadFuse_Trampoline:
|
||||
jmp BootloaderAPI_ReadFuse
|
||||
BootloaderAPI_ReadLock_Trampoline:
|
||||
jmp BootloaderAPI_ReadLock
|
||||
BootloaderAPI_WriteLock_Trampoline:
|
||||
jmp BootloaderAPI_WriteLock
|
||||
BootloaderAPI_UNUSED1:
|
||||
ret
|
||||
BootloaderAPI_UNUSED2:
|
||||
ret
|
||||
BootloaderAPI_UNUSED3:
|
||||
ret
|
||||
BootloaderAPI_UNUSED4:
|
||||
ret
|
||||
BootloaderAPI_UNUSED5:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; API function jump table
|
||||
.section .apitable_jumptable, "ax"
|
||||
.global BootloaderAPI_JumpTable
|
||||
BootloaderAPI_JumpTable:
|
||||
|
||||
rjmp BootloaderAPI_ErasePage_Trampoline
|
||||
rjmp BootloaderAPI_WritePage_Trampoline
|
||||
rjmp BootloaderAPI_FillWord_Trampoline
|
||||
rjmp BootloaderAPI_ReadSignature_Trampoline
|
||||
rjmp BootloaderAPI_ReadFuse_Trampoline
|
||||
rjmp BootloaderAPI_ReadLock_Trampoline
|
||||
rjmp BootloaderAPI_WriteLock_Trampoline
|
||||
rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
|
||||
rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
|
||||
rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
|
||||
rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
|
||||
rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
|
||||
|
||||
|
||||
|
||||
; Bootloader table signatures and information
|
||||
.section .apitable_signatures, "ax"
|
||||
.global BootloaderAPI_Signatures
|
||||
BootloaderAPI_Signatures:
|
||||
|
||||
.long BOOT_START_ADDR ; Start address of the bootloader
|
||||
.word 0xDF30 ; Signature for the MS class bootloader, V1
|
||||
.word 0xDCFB ; Signature for a LUFA class bootloader
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2014.
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that the copyright notice and this
|
||||
permission notice and warranty disclaimer appear in supporting
|
||||
documentation, and that the name of the author not be used in
|
||||
advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
The author disclaims all warranties with regard to this
|
||||
software, including all implied warranties of merchantability
|
||||
and fitness. In no event shall the author be liable for any
|
||||
special, indirect or consequential damages or any damages
|
||||
whatsoever resulting from loss of use, data or profits, whether
|
||||
in an action of contract, negligence or other tortious action,
|
||||
arising out of or in connection with the use or performance of
|
||||
this software.
|
||||
*/
|
||||
|
||||
#if AUX_BOOT_SECTION_SIZE > 0
|
||||
#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation).
|
||||
|
||||
; Trampoline to jump over the AUX bootloader section to the start of the bootloader,
|
||||
; on devices where an AUX bootloader section is used.
|
||||
.section .boot_aux_trampoline, "ax"
|
||||
.global Boot_AUX_Trampoline
|
||||
Boot_AUX_Trampoline:
|
||||
jmp BOOT_START_ADDR
|
||||
#endif
|
||||
|
||||
; Trampolines to actual API implementations if the target address is outside the
|
||||
; range of a rjmp instruction (can happen with large bootloader sections)
|
||||
.section .apitable_trampolines, "ax"
|
||||
.global BootloaderAPI_Trampolines
|
||||
BootloaderAPI_Trampolines:
|
||||
|
||||
BootloaderAPI_ErasePage_Trampoline:
|
||||
jmp BootloaderAPI_ErasePage
|
||||
BootloaderAPI_WritePage_Trampoline:
|
||||
jmp BootloaderAPI_WritePage
|
||||
BootloaderAPI_FillWord_Trampoline:
|
||||
jmp BootloaderAPI_FillWord
|
||||
BootloaderAPI_ReadSignature_Trampoline:
|
||||
jmp BootloaderAPI_ReadSignature
|
||||
BootloaderAPI_ReadFuse_Trampoline:
|
||||
jmp BootloaderAPI_ReadFuse
|
||||
BootloaderAPI_ReadLock_Trampoline:
|
||||
jmp BootloaderAPI_ReadLock
|
||||
BootloaderAPI_WriteLock_Trampoline:
|
||||
jmp BootloaderAPI_WriteLock
|
||||
BootloaderAPI_UNUSED1:
|
||||
ret
|
||||
BootloaderAPI_UNUSED2:
|
||||
ret
|
||||
BootloaderAPI_UNUSED3:
|
||||
ret
|
||||
BootloaderAPI_UNUSED4:
|
||||
ret
|
||||
BootloaderAPI_UNUSED5:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; API function jump table
|
||||
.section .apitable_jumptable, "ax"
|
||||
.global BootloaderAPI_JumpTable
|
||||
BootloaderAPI_JumpTable:
|
||||
|
||||
rjmp BootloaderAPI_ErasePage_Trampoline
|
||||
rjmp BootloaderAPI_WritePage_Trampoline
|
||||
rjmp BootloaderAPI_FillWord_Trampoline
|
||||
rjmp BootloaderAPI_ReadSignature_Trampoline
|
||||
rjmp BootloaderAPI_ReadFuse_Trampoline
|
||||
rjmp BootloaderAPI_ReadLock_Trampoline
|
||||
rjmp BootloaderAPI_WriteLock_Trampoline
|
||||
rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
|
||||
rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
|
||||
rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
|
||||
rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
|
||||
rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
|
||||
|
||||
|
||||
|
||||
; Bootloader table signatures and information
|
||||
.section .apitable_signatures, "ax"
|
||||
.global BootloaderAPI_Signatures
|
||||
BootloaderAPI_Signatures:
|
||||
|
||||
.long BOOT_START_ADDR ; Start address of the bootloader
|
||||
.word 0xDF30 ; Signature for the MS class bootloader, V1
|
||||
.word 0xDCFB ; Signature for a LUFA class bootloader
|
||||
|
@ -1,156 +1,156 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="Mass Storage Bootloader - 128KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.128_8" force-caption="true" workspace-name="lufa_ms_128kb_8kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1E000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 64KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.64_8" force-caption="true" workspace-name="lufa_ms_64kb_8kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xE000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 32KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.32_4" force-caption="true" workspace-name="lufa_ms_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x6810"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x6800"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 16KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.16_4" force-caption="true" workspace-name="lufa_ms_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x2810"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x2800"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.mass_storage" caption="Mass Storage Bootloader">
|
||||
<info type="description" value="summary">
|
||||
Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderMassStorage.c"/>
|
||||
<build type="header-file" value="BootloaderMassStorage.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="include-path" value="Lib"/>
|
||||
<build type="header-file" value="Lib/VirtualFAT.h"/>
|
||||
<build type="c-source" value="Lib/VirtualFAT.c"/>
|
||||
<build type="header-file" value="Lib/SCSI.h"/>
|
||||
<build type="c-source" value="Lib/SCSI.c"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderMassStorage.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="Mass Storage Bootloader - 128KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.128_8" force-caption="true" workspace-name="lufa_ms_128kb_8kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1E000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 64KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.64_8" force-caption="true" workspace-name="lufa_ms_64kb_8kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xE000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 32KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.32_4" force-caption="true" workspace-name="lufa_ms_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x6810"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x6800"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Mass Storage Bootloader - 16KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.16_4" force-caption="true" workspace-name="lufa_ms_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.mass_storage"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x2810"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x2800"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.mass_storage" caption="Mass Storage Bootloader">
|
||||
<info type="description" value="summary">
|
||||
Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderMassStorage.c"/>
|
||||
<build type="header-file" value="BootloaderMassStorage.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
<build type="header-file" value="Config/AppConfig.h"/>
|
||||
|
||||
<build type="include-path" value="Lib"/>
|
||||
<build type="header-file" value="Lib/VirtualFAT.h"/>
|
||||
<build type="c-source" value="Lib/VirtualFAT.c"/>
|
||||
<build type="header-file" value="Lib/SCSI.h"/>
|
||||
<build type="c-source" value="Lib/SCSI.c"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderMassStorage.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,68 +1,68 @@
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
BOARD = USBKEY
|
||||
F_CPU = 8000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = BootloaderMassStorage
|
||||
SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
|
||||
LUFA_PATH = ../../LUFA
|
||||
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
|
||||
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
|
||||
|
||||
# Flash size and bootloader section sizes of the target, in KB. These must
|
||||
# match the target's total FLASH size and the bootloader size set in the
|
||||
# device's fuses.
|
||||
FLASH_SIZE_KB = 128
|
||||
BOOT_SECTION_SIZE_KB = 8
|
||||
|
||||
# Bootloader address calculation formulas
|
||||
# Do not modify these macros, but rather modify the dependent values above.
|
||||
CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
|
||||
BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
|
||||
BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
|
||||
|
||||
# Bootloader linker section flags for relocating the API table sections to
|
||||
# known FLASH addresses - these should not normally be user-edited.
|
||||
BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
|
||||
BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
|
||||
|
||||
# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the
|
||||
# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum
|
||||
# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices.
|
||||
ifeq ($(BOOT_SECTION_SIZE_KB),8)
|
||||
CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0
|
||||
else
|
||||
AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB))
|
||||
|
||||
CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)'
|
||||
LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16))
|
||||
LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024)
|
||||
endif
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
BOARD = USBKEY
|
||||
F_CPU = 8000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = BootloaderMassStorage
|
||||
SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
|
||||
LUFA_PATH = ../../LUFA
|
||||
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
|
||||
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
|
||||
|
||||
# Flash size and bootloader section sizes of the target, in KB. These must
|
||||
# match the target's total FLASH size and the bootloader size set in the
|
||||
# device's fuses.
|
||||
FLASH_SIZE_KB = 128
|
||||
BOOT_SECTION_SIZE_KB = 8
|
||||
|
||||
# Bootloader address calculation formulas
|
||||
# Do not modify these macros, but rather modify the dependent values above.
|
||||
CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
|
||||
BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
|
||||
BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
|
||||
|
||||
# Bootloader linker section flags for relocating the API table sections to
|
||||
# known FLASH addresses - these should not normally be user-edited.
|
||||
BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
|
||||
BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
|
||||
|
||||
# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the
|
||||
# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum
|
||||
# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices.
|
||||
ifeq ($(BOOT_SECTION_SIZE_KB),8)
|
||||
CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0
|
||||
else
|
||||
AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB))
|
||||
|
||||
CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)'
|
||||
LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16))
|
||||
LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024)
|
||||
endif
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
|
@ -1,91 +1,91 @@
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2014.
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that the copyright notice and this
|
||||
permission notice and warranty disclaimer appear in supporting
|
||||
documentation, and that the name of the author not be used in
|
||||
advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
The author disclaims all warranties with regard to this
|
||||
software, including all implied warranties of merchantability
|
||||
and fitness. In no event shall the author be liable for any
|
||||
special, indirect or consequential damages or any damages
|
||||
whatsoever resulting from loss of use, data or profits, whether
|
||||
in an action of contract, negligence or other tortious action,
|
||||
arising out of or in connection with the use or performance of
|
||||
this software.
|
||||
*/
|
||||
|
||||
; Trampolines to actual API implementations if the target address is outside the
|
||||
; range of a rjmp instruction (can happen with large bootloader sections)
|
||||
.section .apitable_trampolines, "ax"
|
||||
.global BootloaderAPI_Trampolines
|
||||
BootloaderAPI_Trampolines:
|
||||
|
||||
BootloaderAPI_ErasePage_Trampoline:
|
||||
jmp BootloaderAPI_ErasePage
|
||||
BootloaderAPI_WritePage_Trampoline:
|
||||
jmp BootloaderAPI_WritePage
|
||||
BootloaderAPI_FillWord_Trampoline:
|
||||
jmp BootloaderAPI_FillWord
|
||||
BootloaderAPI_ReadSignature_Trampoline:
|
||||
jmp BootloaderAPI_ReadSignature
|
||||
BootloaderAPI_ReadFuse_Trampoline:
|
||||
jmp BootloaderAPI_ReadFuse
|
||||
BootloaderAPI_ReadLock_Trampoline:
|
||||
jmp BootloaderAPI_ReadLock
|
||||
BootloaderAPI_WriteLock_Trampoline:
|
||||
jmp BootloaderAPI_WriteLock
|
||||
BootloaderAPI_UNUSED1:
|
||||
ret
|
||||
BootloaderAPI_UNUSED2:
|
||||
ret
|
||||
BootloaderAPI_UNUSED3:
|
||||
ret
|
||||
BootloaderAPI_UNUSED4:
|
||||
ret
|
||||
BootloaderAPI_UNUSED5:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; API function jump table
|
||||
.section .apitable_jumptable, "ax"
|
||||
.global BootloaderAPI_JumpTable
|
||||
BootloaderAPI_JumpTable:
|
||||
|
||||
rjmp BootloaderAPI_ErasePage_Trampoline
|
||||
rjmp BootloaderAPI_WritePage_Trampoline
|
||||
rjmp BootloaderAPI_FillWord_Trampoline
|
||||
rjmp BootloaderAPI_ReadSignature_Trampoline
|
||||
rjmp BootloaderAPI_ReadFuse_Trampoline
|
||||
rjmp BootloaderAPI_ReadLock_Trampoline
|
||||
rjmp BootloaderAPI_WriteLock_Trampoline
|
||||
rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
|
||||
rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
|
||||
rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
|
||||
rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
|
||||
rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
|
||||
|
||||
|
||||
|
||||
; Bootloader table signatures and information
|
||||
.section .apitable_signatures, "ax"
|
||||
.global BootloaderAPI_Signatures
|
||||
BootloaderAPI_Signatures:
|
||||
|
||||
.long BOOT_START_ADDR ; Start address of the bootloader
|
||||
.word 0xDF20 ; Signature for the Printer class bootloader
|
||||
.word 0xDCFB ; Signature for a LUFA class bootloader
|
||||
/*
|
||||
LUFA Library
|
||||
Copyright (C) Dean Camera, 2014.
|
||||
|
||||
dean [at] fourwalledcubicle [dot] com
|
||||
www.lufa-lib.org
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that the copyright notice and this
|
||||
permission notice and warranty disclaimer appear in supporting
|
||||
documentation, and that the name of the author not be used in
|
||||
advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
The author disclaims all warranties with regard to this
|
||||
software, including all implied warranties of merchantability
|
||||
and fitness. In no event shall the author be liable for any
|
||||
special, indirect or consequential damages or any damages
|
||||
whatsoever resulting from loss of use, data or profits, whether
|
||||
in an action of contract, negligence or other tortious action,
|
||||
arising out of or in connection with the use or performance of
|
||||
this software.
|
||||
*/
|
||||
|
||||
; Trampolines to actual API implementations if the target address is outside the
|
||||
; range of a rjmp instruction (can happen with large bootloader sections)
|
||||
.section .apitable_trampolines, "ax"
|
||||
.global BootloaderAPI_Trampolines
|
||||
BootloaderAPI_Trampolines:
|
||||
|
||||
BootloaderAPI_ErasePage_Trampoline:
|
||||
jmp BootloaderAPI_ErasePage
|
||||
BootloaderAPI_WritePage_Trampoline:
|
||||
jmp BootloaderAPI_WritePage
|
||||
BootloaderAPI_FillWord_Trampoline:
|
||||
jmp BootloaderAPI_FillWord
|
||||
BootloaderAPI_ReadSignature_Trampoline:
|
||||
jmp BootloaderAPI_ReadSignature
|
||||
BootloaderAPI_ReadFuse_Trampoline:
|
||||
jmp BootloaderAPI_ReadFuse
|
||||
BootloaderAPI_ReadLock_Trampoline:
|
||||
jmp BootloaderAPI_ReadLock
|
||||
BootloaderAPI_WriteLock_Trampoline:
|
||||
jmp BootloaderAPI_WriteLock
|
||||
BootloaderAPI_UNUSED1:
|
||||
ret
|
||||
BootloaderAPI_UNUSED2:
|
||||
ret
|
||||
BootloaderAPI_UNUSED3:
|
||||
ret
|
||||
BootloaderAPI_UNUSED4:
|
||||
ret
|
||||
BootloaderAPI_UNUSED5:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; API function jump table
|
||||
.section .apitable_jumptable, "ax"
|
||||
.global BootloaderAPI_JumpTable
|
||||
BootloaderAPI_JumpTable:
|
||||
|
||||
rjmp BootloaderAPI_ErasePage_Trampoline
|
||||
rjmp BootloaderAPI_WritePage_Trampoline
|
||||
rjmp BootloaderAPI_FillWord_Trampoline
|
||||
rjmp BootloaderAPI_ReadSignature_Trampoline
|
||||
rjmp BootloaderAPI_ReadFuse_Trampoline
|
||||
rjmp BootloaderAPI_ReadLock_Trampoline
|
||||
rjmp BootloaderAPI_WriteLock_Trampoline
|
||||
rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
|
||||
rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
|
||||
rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
|
||||
rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
|
||||
rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
|
||||
|
||||
|
||||
|
||||
; Bootloader table signatures and information
|
||||
.section .apitable_signatures, "ax"
|
||||
.global BootloaderAPI_Signatures
|
||||
BootloaderAPI_Signatures:
|
||||
|
||||
.long BOOT_START_ADDR ; Start address of the bootloader
|
||||
.word 0xDF20 ; Signature for the Printer class bootloader
|
||||
.word 0xDCFB ; Signature for a LUFA class bootloader
|
||||
|
@ -1,159 +1,159 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="Printer Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.128_4" force-caption="true" workspace-name="lufa_printer_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.64_4" force-caption="true" workspace-name="lufa_printer_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.32_4" force-caption="true" workspace-name="lufa_printer_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.16_4" force-caption="true" workspace-name="lufa_printer_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.8_4" force-caption="true" workspace-name="lufa_printer_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.printer" caption="Printer Bootloader">
|
||||
<info type="description" value="summary">
|
||||
Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderPrinter.c"/>
|
||||
<build type="header-file" value="BootloaderPrinter.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderPrinter.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="Printer Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.128_4" force-caption="true" workspace-name="lufa_printer_128kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.64_4" force-caption="true" workspace-name="lufa_printer_64kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb647"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.32_4" force-caption="true" workspace-name="lufa_printer_32kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega32u4"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.16_4" force-caption="true" workspace-name="lufa_printer_16kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega16u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<project caption="Printer Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.8_4" force-caption="true" workspace-name="lufa_printer_8kb_4kb_">
|
||||
<require idref="lufa.bootloaders.printer"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="atmega8u2"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<config name="config.compiler.optimization.level" value="size"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
|
||||
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
|
||||
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
|
||||
<build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
|
||||
<build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.bootloaders.printer" caption="Printer Bootloader">
|
||||
<info type="description" value="summary">
|
||||
Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="Bootloaders"/>
|
||||
<keyword value="USB Device"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="include-path" value="."/>
|
||||
<build type="c-source" value="BootloaderPrinter.c"/>
|
||||
<build type="header-file" value="BootloaderPrinter.h"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
<build type="c-source" value="BootloaderAPI.c"/>
|
||||
<build type="header-file" value="BootloaderAPI.h"/>
|
||||
<build type="asm-source" value="BootloaderAPITable.S"/>
|
||||
|
||||
<build type="module-config" subtype="path" value="Config"/>
|
||||
<build type="header-file" value="Config/LUFAConfig.h"/>
|
||||
|
||||
<build type="distribute" subtype="user-file" value="doxyfile"/>
|
||||
<build type="distribute" subtype="user-file" value="BootloaderPrinter.txt"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
<require idref="lufa.drivers.board.leds"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,55 +1,55 @@
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
BOARD = USBKEY
|
||||
F_CPU = 8000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = BootloaderPrinter
|
||||
SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
|
||||
LUFA_PATH = ../../LUFA
|
||||
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
|
||||
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
|
||||
|
||||
# Flash size and bootloader section sizes of the target, in KB. These must
|
||||
# match the target's total FLASH size and the bootloader size set in the
|
||||
# device's fuses.
|
||||
FLASH_SIZE_KB = 128
|
||||
BOOT_SECTION_SIZE_KB = 8
|
||||
|
||||
# Bootloader address calculation formulas
|
||||
# Do not modify these macros, but rather modify the dependent values above.
|
||||
CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
|
||||
BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
|
||||
BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
|
||||
|
||||
# Bootloader linker section flags for relocating the API table sections to
|
||||
# known FLASH addresses - these should not normally be user-edited.
|
||||
BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
|
||||
BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
BOARD = USBKEY
|
||||
F_CPU = 8000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = BootloaderPrinter
|
||||
SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
|
||||
LUFA_PATH = ../../LUFA
|
||||
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
|
||||
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
|
||||
|
||||
# Flash size and bootloader section sizes of the target, in KB. These must
|
||||
# match the target's total FLASH size and the bootloader size set in the
|
||||
# device's fuses.
|
||||
FLASH_SIZE_KB = 128
|
||||
BOOT_SECTION_SIZE_KB = 8
|
||||
|
||||
# Bootloader address calculation formulas
|
||||
# Do not modify these macros, but rather modify the dependent values above.
|
||||
CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
|
||||
BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
|
||||
BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
|
||||
|
||||
# Bootloader linker section flags for relocating the API table sections to
|
||||
# known FLASH addresses - these should not normally be user-edited.
|
||||
BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
|
||||
BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
|
||||
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
|
@ -1,42 +1,42 @@
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
F_CPU = 1000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = HID_EEPROM_Loader
|
||||
SRC = $(TARGET).c
|
||||
LUFA_PATH = ../../../LUFA
|
||||
CC_FLAGS =
|
||||
LD_FLAGS =
|
||||
OBJECT_FILES = InputEEData.o
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Determine the AVR sub-architecture of the build main application object file
|
||||
FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
|
||||
|
||||
# Create a linkable object file with the input binary EEPROM data stored in the FLASH section
|
||||
InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)
|
||||
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"
|
||||
avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_hid.mk
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2014.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
# --------------------------------------
|
||||
# LUFA Project Makefile.
|
||||
# --------------------------------------
|
||||
|
||||
# Run "make help" for target help.
|
||||
|
||||
MCU = at90usb1287
|
||||
ARCH = AVR8
|
||||
F_CPU = 1000000
|
||||
F_USB = $(F_CPU)
|
||||
OPTIMIZATION = s
|
||||
TARGET = HID_EEPROM_Loader
|
||||
SRC = $(TARGET).c
|
||||
LUFA_PATH = ../../../LUFA
|
||||
CC_FLAGS =
|
||||
LD_FLAGS =
|
||||
OBJECT_FILES = InputEEData.o
|
||||
|
||||
# Default target
|
||||
all:
|
||||
|
||||
# Determine the AVR sub-architecture of the build main application object file
|
||||
FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
|
||||
|
||||
# Create a linkable object file with the input binary EEPROM data stored in the FLASH section
|
||||
InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)
|
||||
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"
|
||||
avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@
|
||||
|
||||
# Include LUFA build script makefiles
|
||||
include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
include $(LUFA_PATH)/Build/lufa_hid.mk
|
||||
|
@ -1,55 +1,55 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="USB Device Template" id="lufa.templates.device.project.avr8">
|
||||
<require idref="lufa.templates.device"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="usbkey"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="8000000UL"/>
|
||||
<build type="define" name="F_USB" value="8000000UL"/>
|
||||
</project>
|
||||
|
||||
<project caption="USB Device Template" id="lufa.templates.device.project.xmega">
|
||||
<require idref="lufa.templates.device"/>
|
||||
<require idref="lufa.boards.dummy.xmega"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="atxmega256a3bu"/>
|
||||
<config name="lufa.drivers.board.name" value="a3bu_xplained"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="32000000UL"/>
|
||||
<build type="define" name="F_USB" value="48000000UL"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.templates.device" caption="USB Device Template">
|
||||
<info type="description" value="summary">
|
||||
Template for a LUFA USB device mode application.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="USB Device"/>
|
||||
<keyword value="Template Projects"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="c-source" value="DeviceApplication.c"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="DeviceApplication.h"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value=".."/>
|
||||
<build type="header-file" value="../LUFAConfig.h"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="USB Device Template" id="lufa.templates.device.project.avr8">
|
||||
<require idref="lufa.templates.device"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="usbkey"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="8000000UL"/>
|
||||
<build type="define" name="F_USB" value="8000000UL"/>
|
||||
</project>
|
||||
|
||||
<project caption="USB Device Template" id="lufa.templates.device.project.xmega">
|
||||
<require idref="lufa.templates.device"/>
|
||||
<require idref="lufa.boards.dummy.xmega"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="atxmega256a3bu"/>
|
||||
<config name="lufa.drivers.board.name" value="a3bu_xplained"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="32000000UL"/>
|
||||
<build type="define" name="F_USB" value="48000000UL"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.templates.device" caption="USB Device Template">
|
||||
<info type="description" value="summary">
|
||||
Template for a LUFA USB device mode application.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="USB Device"/>
|
||||
<keyword value="Template Projects"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="c-source" value="DeviceApplication.c"/>
|
||||
<build type="c-source" value="Descriptors.c"/>
|
||||
<build type="header-file" value="DeviceApplication.h"/>
|
||||
<build type="header-file" value="Descriptors.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value=".."/>
|
||||
<build type="header-file" value="../LUFAConfig.h"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,41 +1,41 @@
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="USB Host Template" id="lufa.templates.host.project">
|
||||
<require idref="lufa.templates.host"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="usbkey"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="8000000UL"/>
|
||||
<build type="define" name="F_USB" value="8000000UL"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.templates.host" caption="USB Host Template">
|
||||
<info type="description" value="summary">
|
||||
Template for a LUFA USB host mode application.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="USB Host"/>
|
||||
<keyword value="Template Projects"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="c-source" value="HostApplication.c"/>
|
||||
<build type="header-file" value="HostApplication.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value=".."/>
|
||||
<build type="header-file" value="../LUFAConfig.h"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
</module>
|
||||
</asf>
|
||||
<asf xmlversion="1.0">
|
||||
<project caption="USB Host Template" id="lufa.templates.host.project">
|
||||
<require idref="lufa.templates.host"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8_template"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="usbkey"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="8000000UL"/>
|
||||
<build type="define" name="F_USB" value="8000000UL"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.templates.host" caption="USB Host Template">
|
||||
<info type="description" value="summary">
|
||||
Template for a LUFA USB host mode application.
|
||||
</info>
|
||||
|
||||
<info type="gui-flag" value="move-to-root"/>
|
||||
|
||||
<info type="keyword" value="Technology">
|
||||
<keyword value="USB Host"/>
|
||||
<keyword value="Template Projects"/>
|
||||
</info>
|
||||
|
||||
<device-support-alias value="lufa_avr8"/>
|
||||
<device-support-alias value="lufa_xmega"/>
|
||||
<device-support-alias value="lufa_uc3"/>
|
||||
|
||||
<build type="c-source" value="HostApplication.c"/>
|
||||
<build type="header-file" value="HostApplication.h"/>
|
||||
|
||||
<build type="module-config" subtype="path" value=".."/>
|
||||
<build type="header-file" value="../LUFAConfig.h"/>
|
||||
|
||||
<require idref="lufa.common"/>
|
||||
<require idref="lufa.platform"/>
|
||||
<require idref="lufa.drivers.usb"/>
|
||||
<require idref="lufa.drivers.board"/>
|
||||
</module>
|
||||
</asf>
|
||||
|
@ -1,975 +1,975 @@
|
||||
/** \file
|
||||
*
|
||||
* This file contains special DoxyGen information for the generation of the main page and other special
|
||||
* documentation pages. It is not a project source file.
|
||||
*/
|
||||
|
||||
/** \page Page_BuildSystem The LUFA Build System
|
||||
*
|
||||
* \section Sec_BuildSystem_Overview Overview of the LUFA Build System
|
||||
* The LUFA build system is an attempt at making a set of re-usable, modular build make files which
|
||||
* can be referenced in a LUFA powered project, to minimize the amount of code required in an
|
||||
* application makefile. The system is written in GNU Make, and each module is independent of
|
||||
* one-another.
|
||||
*
|
||||
* For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA
|
||||
* build system, see \ref Sec_CompilingApps_Prerequisites.
|
||||
*
|
||||
* To use a LUFA build system module, simply add an include to your project makefile. All user projects
|
||||
* should at a minimum include \ref Page_BuildModule_CORE for base functionality:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
* \endcode
|
||||
*
|
||||
* Once included in your project makefile, the associated build module targets will be added to your
|
||||
* project's build makefile targets automatically. To call a build target, run <tt>make {TARGET_NAME}</tt>
|
||||
* from the command line, substituting in the appropriate target name.
|
||||
*
|
||||
* \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile.
|
||||
*
|
||||
* Each build module may have one or more mandatory parameters (GNU Make variables) which <i>must</i>
|
||||
* be supplied in the project makefile for the module to work, and one or more optional parameters which
|
||||
* may be defined and which will assume a sensible default if not.
|
||||
*
|
||||
* \section SSec_BuildSystem_Modules Available Modules
|
||||
*
|
||||
* The following modules are included in this LUFA release:
|
||||
*
|
||||
* \li \subpage Page_BuildModule_ATPROGRAM - Device Programming
|
||||
* \li \subpage Page_BuildModule_AVRDUDE - Device Programming
|
||||
* \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking
|
||||
* \li \subpage Page_BuildModule_CORE - Core Build System Functions
|
||||
* \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis
|
||||
* \li \subpage Page_BuildModule_DFU - Device Programming
|
||||
* \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation
|
||||
* \li \subpage Page_BuildModule_HID - Device Programming
|
||||
* \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables
|
||||
*
|
||||
* If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps.
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_BUILD The BUILD build module
|
||||
*
|
||||
* The BUILD LUFA build system module, providing targets for the compilation,
|
||||
* assembling and linking of an application from source code into binary files
|
||||
* suitable for programming into a target device, using the GCC compiler.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_Requirements Requirements
|
||||
* This module requires the the architecture appropriate binaries of the GCC compiler are available in your
|
||||
* system's <b>PATH</b> variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio
|
||||
* 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>size</tt></td>
|
||||
* <td>Display size of the compiled application FLASH and SRAM segments.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>symbol-sizes</tt></td>
|
||||
* <td>Display a size-sorted list of symbols from the compiled application, in decimal bytes.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>lib</tt></td>
|
||||
* <td>Build and archive all source files into a library A binary file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>all</tt></td>
|
||||
* <td>Build and link the application into ELF debug and HEX binary files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>elf</tt></td>
|
||||
* <td>Build and link the application into an ELF debug file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>bin</tt></td>
|
||||
* <td>Build and link the application and produce a BIN binary file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>hex</tt></td>
|
||||
* <td>Build and link the application and produce HEX and EEP binary files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>lss</tt></td>
|
||||
* <td>Build and link the application and produce a LSS source code/assembly code mixed listing file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>clean</tt></td>
|
||||
* <td>Remove all intermediary files and binary output files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>mostlyclean</tt></td>
|
||||
* <td>Remove all intermediary files but preserve any binary output files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt><i><filename></i>.s</tt></td>
|
||||
* <td>Create an assembly listing of a given input C/C++ source file.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ARCH</tt></td>
|
||||
* <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>SRC</tt></td>
|
||||
* <td>List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>F_USB</tt></td>
|
||||
* <td>Speed in Hz of the input clock frequency to the target's USB controller.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>BOARD</tt></td>
|
||||
* <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OPTIMIZATION</tt></td>
|
||||
* <td>Optimization level to use when compiling source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>C_STANDARD</tt></td>
|
||||
* <td>Version of the C standard to apply when compiling C++ source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPP_STANDARD</tt></td>
|
||||
* <td>Version of the C++ standard to apply when compiling C++ source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DEBUG_FORMAT</tt></td>
|
||||
* <td>Format of the debug information to embed in the generated object files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DEBUG_LEVEL</tt></td>
|
||||
* <td>Level of the debugging information to embed in the generated object files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>F_CPU</tt></td>
|
||||
* <td>Speed of the processor CPU clock, in Hz.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>C_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the C compiler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPP_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the C++ compiler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ASM_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the assembler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CC_FLAGS</tt></td>
|
||||
* <td>Common flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>COMPILER_PATH</tt></td>
|
||||
* <td>Directory where the C/C++ toolchain is located, if not available in the system <tt>PATH</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LD_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the linker, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LINKER_RELAXATIONS</tt></td>
|
||||
* <td>Enables or disables linker relaxations when linking the application binary. This can reduce the total size
|
||||
* of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible.
|
||||
* \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you
|
||||
* receive a link error <tt>relocation truncated to fit: R_AVR_13_PCREL</tt>, disable this setting.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OBJDIR</tt></td>
|
||||
* <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.
|
||||
* \note When this option is enabled, all source filenames <b>must</b> be unique.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OBJECT_FILES</tt></td>
|
||||
* <td>List of additional object files that should be linked into the resulting binary.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_CORE The CORE build module
|
||||
*
|
||||
* The core LUFA build system module, providing common build system help and information targets.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_Requirements Requirements
|
||||
* This module has no requirements outside a standard *nix shell like environment; the <tt>sh</tt>
|
||||
* shell, GNU <tt>make</tt> and *nix CoreUtils (<tt>echo</tt>, <tt>printf</tt>, etc.).
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>help</tt></td>
|
||||
* <td>Display build system help and configuration information.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_targets</tt></td>
|
||||
* <td>List all available build targets from the build system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_modules</tt></td>
|
||||
* <td>List all available build modules from the build system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_mandatory</tt></td>
|
||||
* <td>List all mandatory parameters required by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_optional</tt></td>
|
||||
* <td>List all optional parameters required by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_provided</tt></td>
|
||||
* <td>List all variables provided by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_macros</tt></td>
|
||||
* <td>List all macros provided by the included modules.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module
|
||||
*
|
||||
* The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_Requirements Requirements
|
||||
* This module requires the <tt>atprogram.exe</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>atprogram.exe</tt> utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x
|
||||
* inside the application install folder's "\atbackend" subdirectory.
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>atprogram</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>atprogram-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_PROGRAMMER</tt></td>
|
||||
* <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. <tt>jtagice3</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_INTERFACE</tt></td>
|
||||
* <td>Name of the programming interface to use when programming the target (e.g. <tt>spi</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_PORT</tt></td>
|
||||
* <td>Name of the communication port to use when when programming with a serially connected tool (e.g. <tt>COM2</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module
|
||||
*
|
||||
* The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_Requirements Requirements
|
||||
* This module requires the <tt>avrdude</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>avrdude</tt> utility is distributed in the old WinAVR project releases for
|
||||
* Windows (<a>http://winavr.sourceforge.net</a>) or can be installed on *nix systems via the project's
|
||||
* source code (<a>https://savannah.nongnu.org/projects/avrdude</a>) or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>avrdude</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>avrdude-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_PROGRAMMER</tt></td>
|
||||
* <td>Name of the programmer or debugger tool to communicate with (e.g. <tt>jtagicemkii</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_PORT</tt></td>
|
||||
* <td>Name of the communication port to use when when programming with the connected tool (e.g. <tt>COM2</tt>, <tt>/dev/ttyUSB0</tt> or <tt>usb</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_FLAGS</tt></td>
|
||||
* <td>Additional flags to pass to avrdude when programming, applied after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_CPPCHECK The CPPCHECK build module
|
||||
*
|
||||
* The CPPCHECK programming utility LUFA build system module, providing targets to statically
|
||||
* analyze C and C++ source code for errors and performance/style issues.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_Requirements Requirements
|
||||
* This module requires the <tt>cppcheck</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>cppcheck</tt> utility is distributed through the project's home page
|
||||
* (<a>http://cppcheck.sourceforge.net</a>) for Windows, and can be installed on *nix systems via
|
||||
* the project's source code or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>cppcheck</tt></td>
|
||||
* <td>Statically analyze the project source code for issues.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>cppcheck-config</tt></td>
|
||||
* <td>Check the <tt>cppcheck</tt> configuration - scan source code and warn about missing header files and other issues.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>SRC</tt></td>
|
||||
* <td>List of source files to statically analyze.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_INCLUDES</tt></td>
|
||||
* <td>Path of extra directories to check when attemting to resolve C/C++ header file includes.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_EXCLUDES</tt></td>
|
||||
* <td>Paths or path fragments to exclude when analyzing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_MSG_TEMPLATE</tt></td>
|
||||
* <td>Output message template to use when printing errors, warnings and information (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_ENABLE</tt></td>
|
||||
* <td>Analysis rule categories to enable (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_SUPPRESS</tt></td>
|
||||
* <td>Specific analysis rules to suppress (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_FAIL_ON_WARNING</tt></td>
|
||||
* <td>Set to <b>Y</b> to fail the analysis job with an error exit code if warnings are found, <b>N</b> to continue without failing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_QUIET</tt></td>
|
||||
* <td>Set to <b>Y</b> to suppress all output except warnings and errors, <b>N</b> to show verbose output information.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_FLAGS</tt></td>
|
||||
* <td>Extra flags to pass to <tt>cppcheck</tt>, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_DFU The DFU build module
|
||||
*
|
||||
* The DFU programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
* This module requires a DFU class bootloader to be running in the target, compatible with
|
||||
* the DFU bootloader protocol as published by Atmel.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_dfu.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_Requirements Requirements
|
||||
* This module requires either the <tt>batchisp</tt> utility from Atmel's FLIP utility, or the open
|
||||
* source <tt>dfu-programmer</tt> utility (<a>http://dfu-programmer.sourceforge.net/</a>) to be
|
||||
* available in your system's <b>PATH</b> variable. On *nix systems the <tt>dfu-programmer</tt> utility
|
||||
* can be installed via the project's source code or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>dfu</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>dfu-programmer</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>dfu-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>dfu-programmer</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>flip</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>batchisp</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>flip-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>batchisp</tt>.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_DOXYGEN The DOXYGEN build module
|
||||
*
|
||||
* The DOXYGEN code documentation utility LUFA build system module, providing targets to generate
|
||||
* project HTML and other format documentation from a set of source files that include special
|
||||
* Doxygen comments.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_Requirements Requirements
|
||||
* This module requires the <tt>doxygen</tt> utility from the Doxygen website
|
||||
* (<a>http://www.doxygen.org/</a>) to be available in your system's <b>PATH</b> variable. On *nix
|
||||
* systems the <tt>doxygen</tt> utility can be installed via the project's source code or through
|
||||
* the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>doxygen</tt></td>
|
||||
* <td>Generate project documentation.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>doxygen_create</tt></td>
|
||||
* <td>Create a new Doxygen configuration file using the latest template.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>doxygen_upgrade</tt></td>
|
||||
* <td>Upgrade an existing Doxygen configuration file to the latest template</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_CONF</tt></td>
|
||||
* <td>Name and path of the base Doxygen configuration file for the project.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_FAIL_ON_WARNING</tt></td>
|
||||
* <td>Set to <b>Y</b> to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, <b>N</b> to continue without failing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_OVERRIDE_PARAMS</tt></td>
|
||||
* <td>Extra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. <tt>QUIET=YES</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_HID The HID build module
|
||||
*
|
||||
* The HID programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor's FLASH memory with a project's compiled binary output file. This module
|
||||
* requires a HID class bootloader to be running in the target, using a protocol compatible
|
||||
* with the PJRC "HalfKay" protocol (<a>http://www.pjrc.com/teensy/halfkay_protocol.html</a>).
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_hid.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_HID_Requirements Requirements
|
||||
* This module requires either the <tt>hid_bootloader_cli</tt> utility from the included LUFA HID
|
||||
* class bootloader API subdirectory, or the <tt>teensy_loader_cli</tt> utility from PJRC
|
||||
* (<a>http://www.pjrc.com/teensy/loader_cli.html</a>) to be available in your system's <b>PATH</b>
|
||||
* variable.
|
||||
*
|
||||
* \section SSec_BuildModule_HID_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>hid</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>hid_bootloader_cli</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>hid-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>hid_bootloader_cli</tt> and
|
||||
* a temporary AVR application programmed into the target's FLASH.
|
||||
* \note This will erase the currently loaded application in the target.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>teensy</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>teensy_loader_cli</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>teensy-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>teensy_loader_cli</tt> and
|
||||
* a temporary AVR application programmed into the target's FLASH.
|
||||
* \note This will erase the currently loaded application in the target.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_SOURCES The SOURCES build module
|
||||
*
|
||||
* The SOURCES LUFA build system module, providing variables listing the various LUFA source files
|
||||
* required to be build by a project for a given LUFA module. This module gives a way to reference
|
||||
* LUFA source files symbolically, so that changes to the library structure do not break the library
|
||||
* makefile.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_Requirements Requirements
|
||||
* None.
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ARCH</tt></td>
|
||||
* <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_USB</tt></td>
|
||||
* <td>List of LUFA USB driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_USBCLASS</tt></td>
|
||||
* <td>List of LUFA USB Class driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_TEMPERATURE</tt></td>
|
||||
* <td>List of LUFA temperature sensor driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_SERIAL</tt></td>
|
||||
* <td>List of LUFA Serial U(S)ART driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_TWI</tt></td>
|
||||
* <td>List of LUFA TWI driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_PLATFORM</tt></td>
|
||||
* <td>List of LUFA architecture specific platform management source files.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildTroubleshooting Troubleshooting Information
|
||||
*
|
||||
* LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these
|
||||
* features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different
|
||||
* errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions.
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <th>Problem</th>
|
||||
* <th>Resolution</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>relocation truncated to fit: R_AVR_13_PCREL against symbol <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>Try compiling with the setting <tt>LINKER_RELAXATIONS=N</tt> in your LUFA Build System 2.0 makefile, or remove the line <tt>-Wl,--relax</tt>
|
||||
* from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>error: ld terminated with signal 11 [Segmentation fault]</tt></b>" shown when compiling.</td>
|
||||
* <td>Try compiling with the setting <tt>DEBUG_LEVEL=2</tt> in your LUFA Build System 2.0 makefile, or make sure you are using <tt>binutils</tt> version 2.22 or later.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>EMERGENCY ABORT: INFINITE RECURSION DETECTED</tt></b>" shown when compiling.</td>
|
||||
* <td>Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with
|
||||
* GNU make or other variants of Make causing an infinitely recursive build.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Unsupported architecture "<i>{X}</i>"</tt></b>" shown when compiling.</td>
|
||||
* <td>Ensure your makefile's <tt>ARCH</tt> setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> value not set</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA
|
||||
* build system modules. Define the value in your project makefile and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> option cannot be blank</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration
|
||||
* option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> option must be Y or N</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No").
|
||||
* This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Unknown input source file formats: <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>The nominated source files, specified in your project's makefile in the <tt>SRC</tt> configuration option, has an extension that the LUFA build system does not
|
||||
* recognise. The file extensions are case sensitive, and must be one of the supported formats (<tt>*.c</tt>, <tt>*.cpp</tt> or <tt>*.S</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Cannot build with OBJDIR parameter set - one or more object file name is not unique</tt></b>" shown when compiling.</td>
|
||||
* <td>When a project is built with a non-empty <tt>OBJDIR</tt> object directory name set, all input source files must have unique names, excluding extension and path.
|
||||
* This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Source file does not exist: <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>The nominated input source file, specified in the user project's <tt>SRC</tt> parameter, could not be found. Ensure the source file exists and the absolute or
|
||||
* relative path given in the user project makefile is correct and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Doxygen configuration file <i>{X}</i> does not exist</tt></b>" shown when upgrading a Doxygen configuration file.</td>
|
||||
* <td>The nominated Doxygen configuration file, specified in the user project's <tt>DOXYGEN_CONF</tt> parameter, could not be found. Ensure the configuration file exists
|
||||
* and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration
|
||||
* file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>avr-gcc: error: unrecognized option '<i>{X}</i>'</tt></b>" shown when compiling.</td>
|
||||
* <td>An unrecognised option was supplied to the compiler, usually in the <tt>C_FLAGS</tt>, <tt>CPP_FLAGS</tt>, <tt>ASM_FLAGS</tt> or <tt>CC_FLAGS</tt> configuration
|
||||
* options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or
|
||||
* upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>makefile:{X}: {Y}.mk: No such file or directory</tt></b>" shown when make is invoked.</td>
|
||||
* <td>The path to the nominated makefile module was incorrect. This usually indicates that the makefile <tt>LUFA_PATH</tt> option is not set to a valid relative or
|
||||
* absolute path to the LUFA library core.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>fatal error: LUFAConfig.h: No such file or directory</tt></b>" shown when compiling.</td>
|
||||
* <td>The <tt>USE_LUFA_CONFIG_HEADER</tt> compile time option was set in the user project makefile, but the user supplied <tt>LUFAConfig.h</tt> header could not be
|
||||
* found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile <tt>CC_FLAGS</tt>
|
||||
* parameter.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>ld.exe: section .apitable_trampolines loaded at <i>{X}</i> overlaps section .text</tt></b>" shown when compiling a bootloader.</td>
|
||||
* <td>The bootloader is compiling too large for the given <tt>FLASH_SIZE_KB</tt> and <tt>BOOT_SECTION_SIZE_KB</tt> parameters set in the bootloader makefile. This
|
||||
* usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the
|
||||
* compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>unknown MCU '<i>{X}</i>' specified</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified microcontroller device model name set in the user application's makefile as the <tt>MCU</tt> parameter is incorrect, or unsupported by the
|
||||
* version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>undefined reference to `<i>{X}</i>'</tt></b>" shown when compiling.</td>
|
||||
* <td>This is usually caused by a missing source file in the user application's <tt>SRC</tt> configuration parameter. If the indicated symbol is one from the LUFA
|
||||
* library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp.
|
||||
*/
|
||||
/** \file
|
||||
*
|
||||
* This file contains special DoxyGen information for the generation of the main page and other special
|
||||
* documentation pages. It is not a project source file.
|
||||
*/
|
||||
|
||||
/** \page Page_BuildSystem The LUFA Build System
|
||||
*
|
||||
* \section Sec_BuildSystem_Overview Overview of the LUFA Build System
|
||||
* The LUFA build system is an attempt at making a set of re-usable, modular build make files which
|
||||
* can be referenced in a LUFA powered project, to minimize the amount of code required in an
|
||||
* application makefile. The system is written in GNU Make, and each module is independent of
|
||||
* one-another.
|
||||
*
|
||||
* For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA
|
||||
* build system, see \ref Sec_CompilingApps_Prerequisites.
|
||||
*
|
||||
* To use a LUFA build system module, simply add an include to your project makefile. All user projects
|
||||
* should at a minimum include \ref Page_BuildModule_CORE for base functionality:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
* \endcode
|
||||
*
|
||||
* Once included in your project makefile, the associated build module targets will be added to your
|
||||
* project's build makefile targets automatically. To call a build target, run <tt>make {TARGET_NAME}</tt>
|
||||
* from the command line, substituting in the appropriate target name.
|
||||
*
|
||||
* \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile.
|
||||
*
|
||||
* Each build module may have one or more mandatory parameters (GNU Make variables) which <i>must</i>
|
||||
* be supplied in the project makefile for the module to work, and one or more optional parameters which
|
||||
* may be defined and which will assume a sensible default if not.
|
||||
*
|
||||
* \section SSec_BuildSystem_Modules Available Modules
|
||||
*
|
||||
* The following modules are included in this LUFA release:
|
||||
*
|
||||
* \li \subpage Page_BuildModule_ATPROGRAM - Device Programming
|
||||
* \li \subpage Page_BuildModule_AVRDUDE - Device Programming
|
||||
* \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking
|
||||
* \li \subpage Page_BuildModule_CORE - Core Build System Functions
|
||||
* \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis
|
||||
* \li \subpage Page_BuildModule_DFU - Device Programming
|
||||
* \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation
|
||||
* \li \subpage Page_BuildModule_HID - Device Programming
|
||||
* \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables
|
||||
*
|
||||
* If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps.
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_BUILD The BUILD build module
|
||||
*
|
||||
* The BUILD LUFA build system module, providing targets for the compilation,
|
||||
* assembling and linking of an application from source code into binary files
|
||||
* suitable for programming into a target device, using the GCC compiler.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_build.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_Requirements Requirements
|
||||
* This module requires the the architecture appropriate binaries of the GCC compiler are available in your
|
||||
* system's <b>PATH</b> variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio
|
||||
* 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>size</tt></td>
|
||||
* <td>Display size of the compiled application FLASH and SRAM segments.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>symbol-sizes</tt></td>
|
||||
* <td>Display a size-sorted list of symbols from the compiled application, in decimal bytes.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>lib</tt></td>
|
||||
* <td>Build and archive all source files into a library A binary file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>all</tt></td>
|
||||
* <td>Build and link the application into ELF debug and HEX binary files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>elf</tt></td>
|
||||
* <td>Build and link the application into an ELF debug file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>bin</tt></td>
|
||||
* <td>Build and link the application and produce a BIN binary file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>hex</tt></td>
|
||||
* <td>Build and link the application and produce HEX and EEP binary files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>lss</tt></td>
|
||||
* <td>Build and link the application and produce a LSS source code/assembly code mixed listing file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>clean</tt></td>
|
||||
* <td>Remove all intermediary files and binary output files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>mostlyclean</tt></td>
|
||||
* <td>Remove all intermediary files but preserve any binary output files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt><i><filename></i>.s</tt></td>
|
||||
* <td>Create an assembly listing of a given input C/C++ source file.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ARCH</tt></td>
|
||||
* <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>SRC</tt></td>
|
||||
* <td>List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>F_USB</tt></td>
|
||||
* <td>Speed in Hz of the input clock frequency to the target's USB controller.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>BOARD</tt></td>
|
||||
* <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OPTIMIZATION</tt></td>
|
||||
* <td>Optimization level to use when compiling source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>C_STANDARD</tt></td>
|
||||
* <td>Version of the C standard to apply when compiling C++ source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPP_STANDARD</tt></td>
|
||||
* <td>Version of the C++ standard to apply when compiling C++ source files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DEBUG_FORMAT</tt></td>
|
||||
* <td>Format of the debug information to embed in the generated object files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DEBUG_LEVEL</tt></td>
|
||||
* <td>Level of the debugging information to embed in the generated object files (see GCC manual).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>F_CPU</tt></td>
|
||||
* <td>Speed of the processor CPU clock, in Hz.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>C_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the C compiler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPP_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the C++ compiler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ASM_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the assembler only, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CC_FLAGS</tt></td>
|
||||
* <td>Common flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>COMPILER_PATH</tt></td>
|
||||
* <td>Directory where the C/C++ toolchain is located, if not available in the system <tt>PATH</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LD_FLAGS</tt></td>
|
||||
* <td>Flags to pass to the linker, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LINKER_RELAXATIONS</tt></td>
|
||||
* <td>Enables or disables linker relaxations when linking the application binary. This can reduce the total size
|
||||
* of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible.
|
||||
* \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you
|
||||
* receive a link error <tt>relocation truncated to fit: R_AVR_13_PCREL</tt>, disable this setting.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OBJDIR</tt></td>
|
||||
* <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.
|
||||
* \note When this option is enabled, all source filenames <b>must</b> be unique.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>OBJECT_FILES</tt></td>
|
||||
* <td>List of additional object files that should be linked into the resulting binary.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_CORE The CORE build module
|
||||
*
|
||||
* The core LUFA build system module, providing common build system help and information targets.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_core.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_Requirements Requirements
|
||||
* This module has no requirements outside a standard *nix shell like environment; the <tt>sh</tt>
|
||||
* shell, GNU <tt>make</tt> and *nix CoreUtils (<tt>echo</tt>, <tt>printf</tt>, etc.).
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>help</tt></td>
|
||||
* <td>Display build system help and configuration information.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_targets</tt></td>
|
||||
* <td>List all available build targets from the build system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_modules</tt></td>
|
||||
* <td>List all available build modules from the build system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_mandatory</tt></td>
|
||||
* <td>List all mandatory parameters required by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_optional</tt></td>
|
||||
* <td>List all optional parameters required by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_provided</tt></td>
|
||||
* <td>List all variables provided by the included modules.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>list_macros</tt></td>
|
||||
* <td>List all macros provided by the included modules.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module
|
||||
*
|
||||
* The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_atprogram.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_Requirements Requirements
|
||||
* This module requires the <tt>atprogram.exe</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>atprogram.exe</tt> utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x
|
||||
* inside the application install folder's "\atbackend" subdirectory.
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>atprogram</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>atprogram-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_PROGRAMMER</tt></td>
|
||||
* <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. <tt>jtagice3</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_INTERFACE</tt></td>
|
||||
* <td>Name of the programming interface to use when programming the target (e.g. <tt>spi</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ATPROGRAM_PORT</tt></td>
|
||||
* <td>Name of the communication port to use when when programming with a serially connected tool (e.g. <tt>COM2</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module
|
||||
*
|
||||
* The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_avrdude.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_Requirements Requirements
|
||||
* This module requires the <tt>avrdude</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>avrdude</tt> utility is distributed in the old WinAVR project releases for
|
||||
* Windows (<a>http://winavr.sourceforge.net</a>) or can be installed on *nix systems via the project's
|
||||
* source code (<a>https://savannah.nongnu.org/projects/avrdude</a>) or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>avrdude</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>avrdude-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_PROGRAMMER</tt></td>
|
||||
* <td>Name of the programmer or debugger tool to communicate with (e.g. <tt>jtagicemkii</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_PORT</tt></td>
|
||||
* <td>Name of the communication port to use when when programming with the connected tool (e.g. <tt>COM2</tt>, <tt>/dev/ttyUSB0</tt> or <tt>usb</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>AVRDUDE_FLAGS</tt></td>
|
||||
* <td>Additional flags to pass to avrdude when programming, applied after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_CPPCHECK The CPPCHECK build module
|
||||
*
|
||||
* The CPPCHECK programming utility LUFA build system module, providing targets to statically
|
||||
* analyze C and C++ source code for errors and performance/style issues.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_cppcheck.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_Requirements Requirements
|
||||
* This module requires the <tt>cppcheck</tt> utility to be available in your system's <b>PATH</b>
|
||||
* variable. The <tt>cppcheck</tt> utility is distributed through the project's home page
|
||||
* (<a>http://cppcheck.sourceforge.net</a>) for Windows, and can be installed on *nix systems via
|
||||
* the project's source code or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>cppcheck</tt></td>
|
||||
* <td>Statically analyze the project source code for issues.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>cppcheck-config</tt></td>
|
||||
* <td>Check the <tt>cppcheck</tt> configuration - scan source code and warn about missing header files and other issues.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>SRC</tt></td>
|
||||
* <td>List of source files to statically analyze.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_INCLUDES</tt></td>
|
||||
* <td>Path of extra directories to check when attemting to resolve C/C++ header file includes.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_EXCLUDES</tt></td>
|
||||
* <td>Paths or path fragments to exclude when analyzing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_MSG_TEMPLATE</tt></td>
|
||||
* <td>Output message template to use when printing errors, warnings and information (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_ENABLE</tt></td>
|
||||
* <td>Analysis rule categories to enable (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_SUPPRESS</tt></td>
|
||||
* <td>Specific analysis rules to suppress (see <tt>cppcheck</tt> documentation).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_FAIL_ON_WARNING</tt></td>
|
||||
* <td>Set to <b>Y</b> to fail the analysis job with an error exit code if warnings are found, <b>N</b> to continue without failing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_QUIET</tt></td>
|
||||
* <td>Set to <b>Y</b> to suppress all output except warnings and errors, <b>N</b> to show verbose output information.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>CPPCHECK_FLAGS</tt></td>
|
||||
* <td>Extra flags to pass to <tt>cppcheck</tt>, after the automatically generated flags.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_DFU The DFU build module
|
||||
*
|
||||
* The DFU programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
|
||||
* This module requires a DFU class bootloader to be running in the target, compatible with
|
||||
* the DFU bootloader protocol as published by Atmel.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_dfu.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_Requirements Requirements
|
||||
* This module requires either the <tt>batchisp</tt> utility from Atmel's FLIP utility, or the open
|
||||
* source <tt>dfu-programmer</tt> utility (<a>http://dfu-programmer.sourceforge.net/</a>) to be
|
||||
* available in your system's <b>PATH</b> variable. On *nix systems the <tt>dfu-programmer</tt> utility
|
||||
* can be installed via the project's source code or through the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>dfu</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>dfu-programmer</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>dfu-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>dfu-programmer</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>flip</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>batchisp</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>flip-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>batchisp</tt>.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_DOXYGEN The DOXYGEN build module
|
||||
*
|
||||
* The DOXYGEN code documentation utility LUFA build system module, providing targets to generate
|
||||
* project HTML and other format documentation from a set of source files that include special
|
||||
* Doxygen comments.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_doxygen.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_Requirements Requirements
|
||||
* This module requires the <tt>doxygen</tt> utility from the Doxygen website
|
||||
* (<a>http://www.doxygen.org/</a>) to be available in your system's <b>PATH</b> variable. On *nix
|
||||
* systems the <tt>doxygen</tt> utility can be installed via the project's source code or through
|
||||
* the package manager.
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>doxygen</tt></td>
|
||||
* <td>Generate project documentation.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>doxygen_create</tt></td>
|
||||
* <td>Create a new Doxygen configuration file using the latest template.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>doxygen_upgrade</tt></td>
|
||||
* <td>Upgrade an existing Doxygen configuration file to the latest template</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_CONF</tt></td>
|
||||
* <td>Name and path of the base Doxygen configuration file for the project.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_FAIL_ON_WARNING</tt></td>
|
||||
* <td>Set to <b>Y</b> to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, <b>N</b> to continue without failing.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>DOXYGEN_OVERRIDE_PARAMS</tt></td>
|
||||
* <td>Extra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. <tt>QUIET=YES</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_HID The HID build module
|
||||
*
|
||||
* The HID programming utility LUFA build system module, providing targets to reprogram an
|
||||
* Atmel processor's FLASH memory with a project's compiled binary output file. This module
|
||||
* requires a HID class bootloader to be running in the target, using a protocol compatible
|
||||
* with the PJRC "HalfKay" protocol (<a>http://www.pjrc.com/teensy/halfkay_protocol.html</a>).
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_hid.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_HID_Requirements Requirements
|
||||
* This module requires either the <tt>hid_bootloader_cli</tt> utility from the included LUFA HID
|
||||
* class bootloader API subdirectory, or the <tt>teensy_loader_cli</tt> utility from PJRC
|
||||
* (<a>http://www.pjrc.com/teensy/loader_cli.html</a>) to be available in your system's <b>PATH</b>
|
||||
* variable.
|
||||
*
|
||||
* \section SSec_BuildModule_HID_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>hid</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>hid_bootloader_cli</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>hid-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>hid_bootloader_cli</tt> and
|
||||
* a temporary AVR application programmed into the target's FLASH.
|
||||
* \note This will erase the currently loaded application in the target.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>teensy</tt></td>
|
||||
* <td>Program the device FLASH memory with the application's executable data using <tt>teensy_loader_cli</tt>.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>teensy-ee</tt></td>
|
||||
* <td>Program the device EEPROM memory with the application's EEPROM data using <tt>teensy_loader_cli</tt> and
|
||||
* a temporary AVR application programmed into the target's FLASH.
|
||||
* \note This will erase the currently loaded application in the target.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>MCU</tt></td>
|
||||
* <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>TARGET</tt></td>
|
||||
* <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildModule_SOURCES The SOURCES build module
|
||||
*
|
||||
* The SOURCES LUFA build system module, providing variables listing the various LUFA source files
|
||||
* required to be build by a project for a given LUFA module. This module gives a way to reference
|
||||
* LUFA source files symbolically, so that changes to the library structure do not break the library
|
||||
* makefile.
|
||||
*
|
||||
* To use this module in your application makefile, add the following code:
|
||||
* \code
|
||||
* include $(LUFA_PATH)/Build/lufa_sources.mk
|
||||
* \endcode
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_Requirements Requirements
|
||||
* None.
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_Targets Targets
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_PATH</tt></td>
|
||||
* <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>ARCH</tt></td>
|
||||
* <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_USB</tt></td>
|
||||
* <td>List of LUFA USB driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_USBCLASS</tt></td>
|
||||
* <td>List of LUFA USB Class driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_TEMPERATURE</tt></td>
|
||||
* <td>List of LUFA temperature sensor driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_SERIAL</tt></td>
|
||||
* <td>List of LUFA Serial U(S)ART driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_TWI</tt></td>
|
||||
* <td>List of LUFA TWI driver source files.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td><tt>LUFA_SRC_PLATFORM</tt></td>
|
||||
* <td>List of LUFA architecture specific platform management source files.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td><i>None</i></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
|
||||
/** \page Page_BuildTroubleshooting Troubleshooting Information
|
||||
*
|
||||
* LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these
|
||||
* features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different
|
||||
* errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions.
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <th>Problem</th>
|
||||
* <th>Resolution</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>relocation truncated to fit: R_AVR_13_PCREL against symbol <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>Try compiling with the setting <tt>LINKER_RELAXATIONS=N</tt> in your LUFA Build System 2.0 makefile, or remove the line <tt>-Wl,--relax</tt>
|
||||
* from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>error: ld terminated with signal 11 [Segmentation fault]</tt></b>" shown when compiling.</td>
|
||||
* <td>Try compiling with the setting <tt>DEBUG_LEVEL=2</tt> in your LUFA Build System 2.0 makefile, or make sure you are using <tt>binutils</tt> version 2.22 or later.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>EMERGENCY ABORT: INFINITE RECURSION DETECTED</tt></b>" shown when compiling.</td>
|
||||
* <td>Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with
|
||||
* GNU make or other variants of Make causing an infinitely recursive build.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Unsupported architecture "<i>{X}</i>"</tt></b>" shown when compiling.</td>
|
||||
* <td>Ensure your makefile's <tt>ARCH</tt> setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> value not set</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA
|
||||
* build system modules. Define the value in your project makefile and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> option cannot be blank</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration
|
||||
* option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Makefile <i>{X}</i> option must be Y or N</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No").
|
||||
* This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Unknown input source file formats: <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>The nominated source files, specified in your project's makefile in the <tt>SRC</tt> configuration option, has an extension that the LUFA build system does not
|
||||
* recognise. The file extensions are case sensitive, and must be one of the supported formats (<tt>*.c</tt>, <tt>*.cpp</tt> or <tt>*.S</tt>).</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Cannot build with OBJDIR parameter set - one or more object file name is not unique</tt></b>" shown when compiling.</td>
|
||||
* <td>When a project is built with a non-empty <tt>OBJDIR</tt> object directory name set, all input source files must have unique names, excluding extension and path.
|
||||
* This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Source file does not exist: <i>{X}</i></tt></b>" shown when compiling.</td>
|
||||
* <td>The nominated input source file, specified in the user project's <tt>SRC</tt> parameter, could not be found. Ensure the source file exists and the absolute or
|
||||
* relative path given in the user project makefile is correct and try again.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>Doxygen configuration file <i>{X}</i> does not exist</tt></b>" shown when upgrading a Doxygen configuration file.</td>
|
||||
* <td>The nominated Doxygen configuration file, specified in the user project's <tt>DOXYGEN_CONF</tt> parameter, could not be found. Ensure the configuration file exists
|
||||
* and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration
|
||||
* file.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>avr-gcc: error: unrecognized option '<i>{X}</i>'</tt></b>" shown when compiling.</td>
|
||||
* <td>An unrecognised option was supplied to the compiler, usually in the <tt>C_FLAGS</tt>, <tt>CPP_FLAGS</tt>, <tt>ASM_FLAGS</tt> or <tt>CC_FLAGS</tt> configuration
|
||||
* options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or
|
||||
* upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>makefile:{X}: {Y}.mk: No such file or directory</tt></b>" shown when make is invoked.</td>
|
||||
* <td>The path to the nominated makefile module was incorrect. This usually indicates that the makefile <tt>LUFA_PATH</tt> option is not set to a valid relative or
|
||||
* absolute path to the LUFA library core.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>fatal error: LUFAConfig.h: No such file or directory</tt></b>" shown when compiling.</td>
|
||||
* <td>The <tt>USE_LUFA_CONFIG_HEADER</tt> compile time option was set in the user project makefile, but the user supplied <tt>LUFAConfig.h</tt> header could not be
|
||||
* found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile <tt>CC_FLAGS</tt>
|
||||
* parameter.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>ld.exe: section .apitable_trampolines loaded at <i>{X}</i> overlaps section .text</tt></b>" shown when compiling a bootloader.</td>
|
||||
* <td>The bootloader is compiling too large for the given <tt>FLASH_SIZE_KB</tt> and <tt>BOOT_SECTION_SIZE_KB</tt> parameters set in the bootloader makefile. This
|
||||
* usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the
|
||||
* compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>unknown MCU '<i>{X}</i>' specified</tt></b>" shown when compiling.</td>
|
||||
* <td>The specified microcontroller device model name set in the user application's makefile as the <tt>MCU</tt> parameter is incorrect, or unsupported by the
|
||||
* version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>Error "<b><tt>undefined reference to `<i>{X}</i>'</tt></b>" shown when compiling.</td>
|
||||
* <td>This is usually caused by a missing source file in the user application's <tt>SRC</tt> configuration parameter. If the indicated symbol is one from the LUFA
|
||||
* library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp.
|
||||
*/
|
||||
|
Loading…
Reference in new issue