Merge remote-tracking branch 'refs/remotes/jackhumbert/master'

master
Stanley Lai 2016-12-17 13:49:13 -08:00
commit b49d7800ae
1043 changed files with 67889 additions and 16398 deletions

94
.gitattributes vendored 100644
View File

@ -0,0 +1,94 @@
# auto for anything unspecified
* text=auto
# sources
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
*.bat text
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.jsx text
*.json text
*.less text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text
*.sql text
*.styl text
*.ts text
*.xml text
*.xhtml text
# make files (need to always use lf for compatibility with Windows 10 bash)
Makefile eol=lf
*.mk eol=lf
# make files (need to always use lf for compatibility with Windows 10 bash)
*.sh eol=lf
# documentation
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
# hex files
*.hex binary
*.eep binary

6
.gitignore vendored
View File

@ -17,6 +17,7 @@ build/
.build/
*.bak
.vagrant/
quantum/version.h
.idea/
CMakeLists.txt
.DS_STORE
@ -26,3 +27,8 @@ CMakeLists.txt
.project
.settings/
.idea
.browse.VC.db*
*.stackdump
util/Win_Check_Output.txt
.vscode
.stfolder

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "lib/ugfx"]
path = lib/ugfx
url = https://bitbucket.org/Tectu/ugfx
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/google/googletest

View File

@ -9,8 +9,11 @@ branches:
env:
global:
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
matrix:
- TARGET=all-keyboards AUTOGEN=true
- TARGET=test AUTOGEN=false
script:
- make all-keyboards-quick AUTOGEN=true
- make $TARGET AUTOGEN=$AUTOGEN
addons:
apt:
packages:
@ -21,4 +24,8 @@ addons:
- gcc-arm-none-eabi
- binutils-arm-none-eabi
- libnewlib-arm-none-eabi
after_success: bash util/travis_compiled_push.sh
- diffutils
after_success:
if [ "$AUTOGEN" == "true" ]; then
bash util/travis_compiled_push.sh;
fi

28
Dockerfile 100644
View File

@ -0,0 +1,28 @@
FROM debian:jessie
MAINTAINER Erik Dasque <erik@frenchguys.com>
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential \
gcc \
unzip \
wget \
zip \
gcc-avr \
binutils-avr \
avr-libc \
dfu-programmer \
dfu-util \
gcc-arm-none-eabi \
binutils-arm-none-eabi \
libnewlib-arm-none-eabi \
git
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
ENV keyboard=ergodox
ENV subproject=ez
ENV keymap=default
VOLUME /qmk
WORKDIR /qmk

755
Makefile
View File

@ -2,267 +2,554 @@ ifndef VERBOSE
.SILENT:
endif
.DEFAULT_GOAL := all
# Never run this makefile in parallel, as it could screw things up
# It won't affect the submakes, so you still get the speedup from specifying -jx
.NOTPARALLEL:
space := $(subst ,, )
starting_makefile := $(subst $(space),_SPACE_,$(abspath $(firstword $(MAKEFILE_LIST))))
mkfile_path := $(subst $(space),_SPACE_,$(abspath $(lastword $(MAKEFILE_LIST))))
abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path)))
ifneq (,$(findstring /keyboards/,$(starting_makefile)))
possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(abs_tmk_root)/keyboards/%,%,$(starting_makefile))))
ifneq (,$(findstring /keymaps/,$(possible_keyboard)))
KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard)))
KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard)))
ifneq (,$(findstring /,$(KEYBOARD_DIR)))
# SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
# KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
tmk_root = ../../..
else
tmk_root = ../../../..
endif
else
KEYMAP_DIR:=default
KEYBOARD_DIR:=$(possible_keyboard)
ifneq (,$(findstring /,$(KEYBOARD_DIR)))
# SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
# KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
tmk_root = ../../..
else
tmk_root = ../..
endif
endif
else
tmk_root = .
# Allow the silent with lower caps to work the same way as upper caps
ifdef silent
SILENT = $(silent)
endif
# $(info $(KEYBOARD_DIR))
# $(info $(KEYMAP_DIR))
# $(info $(SUBPROJECT_DIR))
# Directory common source filess exist
TOP_DIR = $(tmk_root)
TMK_DIR = tmk_core
TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
LIB_PATH = $(TOP_DIR)/lib
ifdef SILENT
SUB_IS_SILENT := $(SILENT)
endif
QUANTUM_DIR = quantum
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
# We need to make sure that silent is always turned off at the top level
# Otherwise the [OK], [ERROR] and [WARN] messags won't be displayed correctly
override SILENT := false
ON_ERROR := error_occured=1
STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
ROOT_DIR := $(dir $(ROOT_MAKEFILE))
ifeq ($(ROOT_DIR),)
ROOT_DIR := .
endif
ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE))
ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE))
ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE))
ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE))
STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
BUILD_DIR := $(ROOT_DIR)/.build
TEST_DIR := $(BUILD_DIR)/test
ERROR_FILE := $(BUILD_DIR)/error_occured
MAKEFILE_INCLUDED=yes
# Helper function to process the newt element of a space separated path
# It works a bit like the traditional functional head tail
# so the CURRENT_PATH_ELEMENT will beome the new head
# and the PATH_ELEMENTS are the rest that are still unprocessed
define NEXT_PATH_ELEMENT
$$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS)))
$$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
endef
# We change the / to spaces so that we more easily can work with the elements
# separately
PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
# Initialize the path elements list for further processing
$(eval $(call NEXT_PATH_ELEMENT))
# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
# variables depending on which directory you stand in.
# It's really a very simple if else chain, if you squint enough,
# but the makefile syntax makes it very verbose.
# If we are in a subfolder of keyboards
ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
$(eval $(call NEXT_PATH_ELEMENT))
KEYBOARD := $(CURRENT_PATH_ELEMENT)
$(eval $(call NEXT_PATH_ELEMENT))
# If we are in a subfolder of keymaps, or in other words in a keymap
# folder
ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
$(eval $(call NEXT_PATH_ELEMENT))
KEYMAP := $(CURRENT_PATH_ELEMENT)
# else if we are not in the keyboard folder itself
else ifneq ($(CURRENT_PATH_ELEMENT),)
# the we can assume it's a subproject, as no other folders
# should have make files in them
SUBPROJECT := $(CURRENT_PATH_ELEMENT)
$(eval $(call NEXT_PATH_ELEMENT))
# if we are inside a keymap folder of a subproject
ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
$(eval $(call NEXT_PATH_ELEMENT))
KEYMAP := $(CURRENT_PATH_ELEMENT)
endif
endif
endif
# Only consider folders with makefiles, to prevent errors in case there are extra folders
KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile)))
#Compability with the old make variables, anything you specify directly on the command line
# always overrides the detected folders
ifdef keyboard
KEYBOARD ?= $(keyboard)
KEYBOARD := $(keyboard)
endif
ifdef KEYBOARD_DIR
KEYBOARD ?= $(KEYBOARD_DIR)
endif
ifndef KEYBOARD
KEYBOARD=planck
endif
MASTER ?= left
ifdef master
MASTER = $(master)
endif
# converts things to keyboards/subproject
ifneq (,$(findstring /,$(KEYBOARD)))
TEMP:=$(KEYBOARD)
KEYBOARD:=$(firstword $(subst /, ,$(TEMP)))
SUBPROJECT:=$(lastword $(subst /, ,$(TEMP)))
endif
KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)
ifdef sub
SUBPROJECT=$(sub)
SUBPROJECT := $(sub)
endif
ifdef subproject
SUBPROJECT=$(subproject)
SUBPROJECT := $(subproject)
endif
ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","")
KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c
ifndef ARCH
ifneq ("$(wildcard $(KEYBOARD_PATH)/Makefile)","")
include $(KEYBOARD_PATH)/Makefile
endif
endif
else
$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist)
endif
ifdef SUBPROJECT_DEFAULT
SUBPROJECT?=$(SUBPROJECT_DEFAULT)
endif
ifdef SUBPROJECT
SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT)
ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","")
OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c
-include $(SUBPROJECT_PATH)/Makefile
else
$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
endif
endif
ifdef keymap
KEYMAP ?= $(keymap)
KEYMAP := $(keymap)
endif
ifdef KEYMAP_DIR
KEYMAP ?= $(KEYMAP_DIR)
endif
ifndef KEYMAP
KEYMAP = default
endif
KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","")
KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c
-include $(KEYMAP_PATH)/Makefile
else
ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/keymap.c)","")
$(error "$(KEYMAP_PATH)/keymap.c" does not exist)
# Uncomment these for debugging
#$(info Keyboard: $(KEYBOARD))
#$(info Keymap: $(KEYMAP))
#$(info Subproject: $(SUBPROJECT))
#$(info Keyboards: $(KEYBOARDS))
# Set the default goal depening on where we are running make from
# this handles the case where you run make without any arguments
.DEFAULT_GOAL := all
ifneq ($(KEYMAP),)
ifeq ($(SUBPROJECT),)
# Inside a keymap folder, just build the keymap, with the
# default subproject
.DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
else
KEYMAP_PATH = $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
KEYMAP_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/keymap.c
-include $(KEYMAP_PATH)/Makefile
# Inside a subproject keyamp folder, build the keymap
# for that subproject
.DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP)
endif
else ifneq ($(SUBPROJECT),)
# Inside a subproject folder, build all keymaps for that subproject
.DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm
else ifneq ($(KEYBOARD),)
# Inside a keyboard folder, build all keymaps for all subprojects
# Note that this is different from the old behaviour, which would
# build only the default keymap of the default keyboard
.DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm
endif
ifdef SUBPROJECT
TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
else
TARGET ?= $(KEYBOARD)_$(KEYMAP)
endif
BUILD_DIR = .build
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
OBJDIR = $(BUILD_DIR)/obj_$(TARGET)
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H = $(KEYMAP_PATH)/config.h
else
CONFIG_H = $(KEYBOARD_PATH)/config.h
ifdef SUBPROJECT
ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","")
CONFIG_H = $(SUBPROJECT_PATH)/config.h
# Compare the start of the RULE variable with the first argument($1)
# If the rules equals $1 or starts with $1-, RULE_FOUND is set to true
# and $1 is removed from the RULE variable
# Otherwise the RULE_FOUND variable is set to false, and RULE left as it was
# The function is a bit tricky, since there's no built in $(startswith) function
define COMPARE_AND_REMOVE_FROM_RULE_HELPER
ifeq ($1,$$(RULE))
RULE:=
RULE_FOUND := true
else
STARTDASH_REMOVED=$$(subst START$1-,,START$$(RULE))
ifneq ($$(STARTDASH_REMOVED),START$$(RULE))
RULE_FOUND := true
RULE := $$(STARTDASH_REMOVED)
else
RULE_FOUND := false
endif
endif
endif
endef
# # project specific files
SRC += $(KEYBOARD_FILE) \
$(KEYMAP_FILE) \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c \
$(QUANTUM_DIR)/process_keycode/process_leader.c
ifdef SUBPROJECT
SRC += $(SUBPROJECT_FILE)
endif
ifdef SUBPROJECT
SRC += $(SUBPROJECT_FILE)
endif
ifdef SUBPROJECT
SRC += $(SUBPROJECT_FILE)
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_audio.c
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)
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)
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
OPT_DEFS += -DSERIAL_LINK_ENABLE
VAPTH += $(SERIAL_PATH)
endif
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(KEYMAP_PATH)
ifdef SUBPROJECT
VPATH += $(SUBPROJECT_PATH)
endif
VPATH += $(KEYBOARD_PATH)
VPATH += $(TOP_DIR)
VPATH += $(TMK_PATH)
VPATH += $(QUANTUM_PATH)
VPATH += $(QUANTUM_PATH)/keymap_extras
VPATH += $(QUANTUM_PATH)/audio
VPATH += $(QUANTUM_PATH)/process_keycode
# This makes it easier to call COMPARE_AND_REMOVE_FROM_RULE, since it makes it behave like
# a function that returns the value
COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND)
# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
ifdef MCU_FAMILY
PLATFORM=CHIBIOS
# Recursively try to find a match for the start of the rule to be checked
# $1 The list to be checked
# If a match is found, then RULE_FOUND is set to true
# and MATCHED_ITEM to the item that was matched
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3
ifneq ($1,)
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
MATCHED_ITEM := $$(firstword $1)
else
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1)))
endif
endif
endef
# A recursive helper function for finding the longest match
# $1 The list to be checed
# It works by always removing the currently matched item from the list
# and call itself recursively, until a match is found
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
# Stop the recursion when the list is empty
ifneq ($1,)
RULE_BEFORE := $$(RULE)
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
# If a match is found in the current list, otherwise just return what we had before
ifeq ($$(RULE_FOUND),true)
# Save the best match so far and call itself recursivel
BEST_MATCH := $$(MATCHED_ITEM)
BEST_MATCH_RULE := $$(RULE)
RULE_FOUND := false
RULE := $$(RULE_BEFORE)
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1)))
endif
endif
endef
# Recursively try to find the longest match for the start of the rule to be checked
# $1 The list to be checked
# If a match is found, then RULE_FOUND is set to true
# and MATCHED_ITEM to the item that was matched
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER
BEST_MATCH :=
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1))
ifneq ($$(BEST_MATCH),)
RULE_FOUND := true
RULE := $$(BEST_MATCH_RULE)
MATCHED_ITEM := $$(BEST_MATCH)
else
RULE_FOUND := false
MATCHED_ITEM :=
endif
endef
# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST
TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND)
define ALL_IN_LIST_LOOP
OLD_RULE$1 := $$(RULE)
$$(eval $$(call $1,$$(ITEM$1)))
RULE := $$(OLD_RULE$1)
endef
define PARSE_ALL_IN_LIST
$$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1)))
endef
# The entry point for rule parsing
# parses a rule in the format <keyboard>-<subproject>-<keymap>-<target>
# but this particular function only deals with the first <keyboard> part
define PARSE_RULE
RULE := $1
COMMANDS :=
# If the rule starts with allkb, then continue the parsing from
# PARSE_ALL_KEYBOARDS
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true)
$$(eval $$(call PARSE_ALL_KEYBOARDS))
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
$$(eval $$(call PARSE_TEST))
# If the rule starts with the name of a known keyboard, then continue
# the parsing from PARSE_KEYBOARD
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
# Otherwise use the KEYBOARD variable, which is determined either by
# the current directory you run make from, or passed in as an argument
else ifneq ($$(KEYBOARD),)
$$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
else
$$(info make: *** No rule to make target '$1'. Stop.)
# Notice the tab instead of spaces below!
exit 1
endif
endef
# $1 = Keyboard
# Parses a rule in the format <subproject>-<keymap>-<target>
# the keyboard is already known when entering this function
define PARSE_KEYBOARD
CURRENT_KB := $1
# A subproject is any keyboard subfolder with a makefile
SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile)))
# if the rule starts with allsp, then continue with looping over all subprojects
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true)
$$(eval $$(call PARSE_ALL_SUBPROJECTS))
# A special case for matching the defaultsp (default subproject)
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true)
$$(eval $$(call PARSE_SUBPROJECT,defaultsp))
# If the rule starts with the name of a known subproject
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true)
$$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM)))
# Try to use the SUBPROJECT variable, which is either determined by the
# directory which invoked make, or passed as an argument to make
else ifneq ($$(SUBPROJECT),)
$$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT)))
# If there's no matching subproject, we assume it's the default
# This will allow you to leave the subproject part of the target out
else
$$(eval $$(call PARSE_SUBPROJECT,))
endif
endef
# if we are going to compile all keyboards, match the rest of the rule
# for each of them
define PARSE_ALL_KEYBOARDS
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
endef
# $1 Subproject
# When entering this, the keyboard and subproject are known, so now we need
# to determine which keymaps are going to get compiled
define PARSE_SUBPROJECT
# If we want to compile the default subproject, then we need to
# include the correct makefile to determine the actual name of it
CURRENT_SP := $1
ifeq ($$(CURRENT_SP),)
CURRENT_SP := defaultsp
endif
ifeq ($$(CURRENT_SP),defaultsp)
SUBPROJECT_DEFAULT=
$$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
CURRENT_SP := $$(SUBPROJECT_DEFAULT)
endif
# If current subproject is empty (the default was not defined), and we have a list of subproject
# then make all of them
ifeq ($$(CURRENT_SP),)
ifneq ($$(SUBPROJECTS),)
CURRENT_SP := allsp
endif
endif
# The special allsp is handled later
ifneq ($$(CURRENT_SP),allsp)
# get a list of all keymaps
KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
ifneq ($$(CURRENT_SP),)
# if the subproject is defined, then also look for keymaps inside the subproject folder
SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
endif
# if the rule after removing the start of it is empty (we haven't specified a kemap or target)
# compile all the keymaps
ifeq ($$(RULE),)
$$(eval $$(call PARSE_ALL_KEYMAPS))
# The same if allkm was specified
else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
$$(eval $$(call PARSE_ALL_KEYMAPS))
# Try to match the specified keyamp with the list of known keymaps
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
$$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
# Otherwise try to match the keymap from the current folder, or arguments to the make command
else ifneq ($$(KEYMAP),)
$$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
# No matching keymap found, so we assume that the rest of the rule is the target
# If we haven't been able to parse out a subproject, then make all of them
# This is consistent with running make without any arguments from the keyboard
# folder
else ifeq ($1,)
$$(eval $$(call PARSE_ALL_SUBPROJECTS))
# Otherwise, make all keymaps, again this is consistent with how it works without
# any arguments
else
$$(eval $$(call PARSE_ALL_KEYMAPS))
endif
else
# As earlier mentione,d when allsb is specified, we call our self recursively
# for all of the subprojects
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS)))
endif
endef
# If we want to parse all subprojects, but the keyboard doesn't have any,
# then use defaultsp instead
define PARSE_ALL_SUBPROJECTS
ifeq ($$(SUBPROJECTS),)
$$(eval $$(call PARSE_SUBPROJECT,defaultsp))
else
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
endif
endef
# $1 Keymap
# This is the meat of compiling a keyboard, when entering this, everything is known
# keyboard, subproject, and keymap
# Note that we are not directly calling the command here, but instead building a list,
# which will later be processed
define PARSE_KEYMAP
CURRENT_KM = $1
# The rest of the rule is the target
# Remove the leading "-" from the target, as it acts as a separator
MAKE_TARGET := $$(patsubst -%,%,$$(RULE))
# We need to generate an unique indentifer to append to the COMMANDS list
COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM)
# If we are compiling a keyboard without a subproject, we want to display just the name
# of the keyboard, otherwise keyboard/subproject
ifeq ($$(CURRENT_SP),)
KB_SP := $(CURRENT_KB)
else
KB_SP := $(CURRENT_KB)/$$(CURRENT_SP)
endif
# Format it in bold
KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
# Specify the variables that we are passing forward to submake
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM)
# And the first part of the make command
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
# The message to display
MAKE_MSG := $$(MSG_MAKE_KB)
# We run the command differently, depending on if we want more output or not
# The true version for silent output and the false version otherwise
$$(eval $$(call BUILD))
endef
define BUILD
MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR)
COMMANDS += $$(COMMAND)
COMMAND_true_$$(COMMAND) := \
printf "$$(MAKE_MSG)" | \
$$(MAKE_MSG_FORMAT); \
LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
if [ $$$$? -gt 0 ]; \
then $$(PRINT_ERROR_PLAIN); \
elif [ "$$$$LOG" != "" ] ; \
then $$(PRINT_WARNING_PLAIN); \
else \
$$(PRINT_OK); \
fi;
COMMAND_false_$$(COMMAND) := \
printf "$$(MAKE_MSG)\n\n"; \
$$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; \
if [ $$$$? -gt 0 ]; \
then error_occured=1; \
fi;
endef
# Just parse all the keymaps for a specifc keyboard
define PARSE_ALL_KEYMAPS
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS)))
endef
define BUILD_TEST
TEST_NAME := $1
MAKE_TARGET := $2
COMMAND := $1
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
MAKE_VARS := TEST=$$(TEST_NAME)
MAKE_MSG := $$(MSG_MAKE_TEST)
$$(eval $$(call BUILD))
ifneq ($$(MAKE_TARGET),clean)
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
TESTS += $$(TEST_NAME)
TEST_MSG := $$(MSG_TEST)
$$(TEST_NAME)_COMMAND := \
printf "$$(TEST_MSG)\n"; \
$$(TEST_EXECUTABLE); \
if [ $$$$? -gt 0 ]; \
then error_occured=1; \
fi; \
printf "\n";
endif
endef
define PARSE_TEST
TESTS :=
TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE)))
ifeq ($$(TEST_NAME),all)
MATCHED_TESTS := $$(TEST_LIST)
else
MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
endif
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
endef
# Set the silent mode depending on if we are trying to compile multiple keyboards or not
# By default it's on in that case, but it can be overriden by specifying silent=false
# from the command line
define SET_SILENT_MODE
ifdef SUB_IS_SILENT
SILENT_MODE := $(SUB_IS_SILENT)
else ifeq ($$(words $$(COMMANDS)),1)
SILENT_MODE := false
else
SILENT_MODE := true
endif
endef
include $(ROOT_DIR)/message.mk
# The empty line is important here, as it will force a new shell to be created for each command
# Otherwise the command line will become too long with a lot of keyboards and keymaps
define RUN_COMMAND
+error_occured=0;\
$(COMMAND_$(SILENT_MODE)_$(COMMAND))\
if [ $$error_occured -gt 0 ]; then echo $$error_occured > $(ERROR_FILE); fi;
endef
define RUN_TEST
+error_occured=0;\
$($(TEST)_COMMAND))\
if [ $$error_occured -gt 0 ]; then echo $$error_occured > $(ERROR_FILE); fi;
endef
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile)))
.PHONY: $(SUBPROJECTS)
$(SUBPROJECTS): %: %-allkm
# Let's match everything, we handle all the rule parsing ourselves
.PHONY: %
ifndef SKIP_GIT
%:
# Check if we have the CMP tool installed
cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
# Check if the submodules are dirty, and display a warning if they are
git submodule status --recursive 2>/dev/null | \
while IFS= read -r x; do \
case "$$x" in \
\ *) ;; \
*) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
esac \
done
rm -f $(ERROR_FILE) > /dev/null 2>&1
$(eval $(call PARSE_RULE,$@))
$(eval $(call SET_SILENT_MODE))
# Run all the commands in the same shell, notice the + at the first line
# it has to be there to allow parallel execution of the submake
# This always tries to compile everything, even if error occurs in the middle
# But we return the error code at the end, to trigger travis failures
$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
$(foreach TEST,$(TESTS),$(RUN_TEST))
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
else
PLATFORM=AVR
%:
# Check if we have the CMP tool installed
cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
rm -f $(ERROR_FILE) > /dev/null 2>&1
$(eval $(call PARSE_RULE,$@))
$(eval $(call SET_SILENT_MODE))
# Run all the commands in the same shell, notice the + at the first line
# it has to be there to allow parallel execution of the submake
# This always tries to compile everything, even if error occurs in the middle
# But we return the error code at the end, to trigger travis failures
$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
$(foreach TEST,$(TESTS),$(RUN_TEST))
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
endif
include $(TMK_PATH)/common.mk
ifeq ($(PLATFORM),AVR)
include $(TMK_PATH)/protocol/lufa.mk
include $(TMK_PATH)/avr.mk
else ifeq ($(PLATFORM),CHIBIOS)
include $(TMK_PATH)/protocol/chibios.mk
include $(TMK_PATH)/chibios.mk
OPT_OS = chibios
# All should compile everything
.PHONY: all
all: all-keyboards test-all
# Define some shortcuts, mostly for compability with the old syntax
.PHONY: all-keyboards
all-keyboards: allkb-allsp-allkm
.PHONY: all-keyboards-defaults
all-keyboards-defaults: allkb-allsp-default
.PHONY: test
test: test-all
.PHONY: test-clean
test-clean: test-all-clean
# Generate the version.h file
ifndef SKIP_GIT
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
else
$(error Unknown platform)
GIT_VERSION := NA
endif
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
include $(VISUALIZER_PATH)/visualizer.mk
endif
include $(TMK_PATH)/rules.mk
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" -DQMK_BUILDDATE=\"$(BUILD_DATE)\"
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
include $(ROOT_DIR)/testlist.mk

2
Vagrantfile vendored
View File

@ -91,7 +91,7 @@ Vagrant.configure(2) do |config|
Or you can copy and paste the example line below.
cd /vagrant; cd keyboards; cd ergodox_ez; make clean; make
cd /vagrant; cd keyboards; cd ergodox; make clean; make
EOT

254
build_keyboard.mk 100644
View File

@ -0,0 +1,254 @@
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 $(API_SYSEX_ENABLE)), yes)
OPT_DEFS += -DAPI_SYSEX_ENABLE
SRC += $(QUANTUM_DIR)/api/api_sysex.c
OPT_DEFS += -DAPI_ENABLE
SRC += $(QUANTUM_DIR)/api.c
MIDI_ENABLE=yes
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 $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
UNICODE_ENABLE = yes
endif
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE
UNICODE_ENABLE = yes
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 $(PRINTING_ENABLE)), yes)
OPT_DEFS += -DPRINTING_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
SRC += $(TMK_DIR)/protocol/serial_uart.c
endif
ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
OPT_DEFS += $(SERIAL_DEFS)
VAPTH += $(SERIAL_PATH)
endif
ifneq ($(strip $(VARIABLE_TRACE)),)
SRC += $(QUANTUM_DIR)/variable_trace.c
OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
endif
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)/protocol.mk
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

57
build_test.mk 100644
View File

@ -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)

27
common.mk 100644
View File

@ -0,0 +1,27 @@
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 += $(QUANTUM_PATH)/api
COMMON_VPATH += $(SERIAL_PATH)

View File

@ -34,7 +34,7 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [atomic](keyboards/atomic/) - [Atomic] Ortholinear 60% keyboard
### Ergodox EZ
* [ergodox_ez](keyboards/ergodox_ez) - [Ergodox_EZ] Assembled split keyboard
* [ergodox_ez](keyboards/ergodox/ez) - [Ergodox_EZ] Assembled split keyboard
## Other projects
@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv
Build Firmware and Program Controller
-------------------------------------
See [doc/build.md](tmk_core/doc/build.md), or the readme in the particular keyboards/* folder.
See [build environment setup](/readme.md#build-environment-setup), or the readme in the particular keyboards/* folder.

View File

@ -6,7 +6,8 @@ This project includes a Vagrantfile that will allow you to build a new firmware
Using the `/Vagrantfile` in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion).
*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12.
*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:** `vagrant plugin install vagrant-vbguest`
Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below.
@ -20,7 +21,7 @@ See [/doc/keymap.md](/doc/keymap.md).
## Flashing the firmware
The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox_ez/readme.md) gives a great example.
The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox/readme.md) gives a great example.
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.

View File

@ -0,0 +1,96 @@
# How keys are registered, and interpreted by computers
In this file, you can will learn the concepts of how keyboards work over USB,
and you'll be able to better understand what you can expect from changing your
firmware directly.
## Schematic view
Whenever you type on 1 particular key, here is the chain of actions taking
place:
``` text
+------+ +-----+ +----------+ +----------+ +----+
| User |-------->| Key |------>| Firmware |----->| USB wire |---->| OS |
+------+ +-----+ +----------+ +----------+ |----+
```
This scheme is a very simple view of what's going on, and more details follow
in the next sections.
## 1. You Press a Key
Whenever you press a key, the firmware of your keyboard can register this event.
It can register when the key is pressed, held and released.
This usually happens with a [periodic scan of key presses with a frequency around 100 hz](https://github.com/benblazak/ergodox-firmware/blob/master/references.md#typical-keyboard-information).
This speed often is limited by the mechanical key response time, the protocol
to transfer those key presses (here USB HID), and by the software it is used in.
## 2. What the Firmware Sends
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf)
tells what a keyboard can actually send through USB to have a chance to be
properly recognised. This includes a pre-defined list of keycodes which are
simple numbers from `0x00` to `0xE7`. The firmware assigns a keycode to each
key of the keyboard.
The firmware does not send actually letters or characters, but only keycodes.
Thus, by modifying the firmware, you only can modify what keycode is sent over
USB for a given key.
## 3. What the Operating System Does
Once the keycode reaches the operating system, a piece of software has to have
it match an actual character thanks to a keyboard layout. For example, if your
layout is set to QWERTY, a sample of the matching table is as follow:
``` text
| keycode | character |
|---------+-----------|
| 0x04 | a/A |
| 0x05 | b/B |
| 0x06 | c/C |
| ... | ... |
| 0x1C | y/Y |
| 0x1D | z/Z |
| ... | ... |
|---------+-----------|
```
## Back to the firmware
As the layout is generally fixed (unless you create your own), the firmware can
actually call a keycode by its layout name directly to ease things for you.
This is exactly what is done here with `KC_A` actually representing `0x04` in
QWERTY. The full list can be found in `keycode.txt`.
## List of Characters You Can Send
Putting aside shortcuts, having a limited set of keycodes mapped to a limited
layout means that **the list of characters you can assign to a given key only
is the ones present in the layout**.
For example, this means that if you have a QWERTY US layout, and you want to
assign 1 key to produce `€` (euro currency symbol), you are unable to do so,
because the QWERTY US layout does not have such mapping. You could fix that by
using a QWERTY UK layout, or a QWERTY US International.
You may wonder why a keyboard layout containing all of Unicode is not devised
then? The limited number of keycode available through USB simply disallow such
a thing.
## How to (Maybe) Enter Unicode Characters
You can have the firmware send *sequences of keys* to use the [software Unicode
Input
Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of
the target operating system, thus effectively entering characters independently
of the layout defined in the OS.
Yet, it does come with multiple disadvantages:
- Tied to a specific OS a a time (need recompilation when changing OS);
- Within a given OS, does not work in all software;
- Limited to a subset of Unicode on some systems.

View File

@ -2,7 +2,7 @@ Keycode Symbol Table
====================
Keycodes are defined in `common/keycode.h`.
Range of 00-A4 and E0-E7 are identical with HID Usage:
<http://www.usb.org/developers/devclass_docs/Hut1_11.pdf>
<http://www.usb.org/developers/hidpage/Hut1_12v2.pdf>
Virtual keycodes are defined out of above range to support special actions.
@ -84,7 +84,7 @@ KC_PAUSE KC_PAUS 48 Keyboard Pause1
KC_INSERT KC_INS 49 Keyboard Insert1
KC_HOME 4A Keyboard Home1
KC_PGUP 4B Keyboard PageUp1
KC_DELETE KC_DELETE 4C Keyboard Delete Forward
KC_DELETE KC_DEL 4C Keyboard Delete Forward
KC_END 4D Keyboard End1
KC_PGDOWN KC_PGDN 4E Keyboard PageDown1
KC_RIGHT KC_RGHT 4F Keyboard RightArrow1

View File

@ -455,6 +455,35 @@ Turn the backlight on and off without changing level.
### 2.6 Swap-Hands Action
The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command key is pressed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd`
### 2.6.1 Configuration
The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck:
```
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
{{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
{{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
{{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
};
```
Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return {7, 2} (third row, eighth column).
### 2.6.2 Advanced Swap Commands
- **`ACTION_SWAP_HANDS()`** Swaps hands when pressed, returns to normal when released (momentary).
- **`ACTION_SWAP_HANDS_TOGGLE()`** Toggles swap on and off with every keypress.
- **`ACTION_SWAP_HANDS_TAP_TOGGLE()`** Toggles with a tap; momentary when held.
- **`ACTION_SWAP_HANDS_TAP_KEY(key)`** Sends `key` with a tap; momentary swap when held.
- **`ACTION_SWAP_HANDS_ON_OFF()`** Alias for `ACTION_SWAP_HANDS()`
- **`ACTION_SWAP_HANDS_OFF_ON()`** Momentarily turns off swap.
- **`ACTION_SWAP_HANDS_ON()`** Turns on swapping and leaves it on.
- **`ACTION_SWAP_HANDS_OFF()`** Turn off swapping and leaves it off. Good for returning to a known state.
## 3. Layer switching Example
There are some ways to switch layer with 'Layer' actions.

View File

@ -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

View File

@ -0,0 +1,4 @@
Alps64 keyboard firmware
======================
TODO: to be updated.

View File

@ -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

View File

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

View File

@ -0,0 +1,30 @@
#include "amj60.h"
#include "led.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
led_init_ports();
};
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
};
void led_init_ports(void) {
// * Set our LED pins as output
DDRB |= (1<<2);
}
void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB &= ~(1<<2);
} else {
// Turn capslock off
PORTB |= (1<<2);
}
}

View File

@ -0,0 +1,153 @@
#ifndef AMJ60_H
#define AMJ60_H
#include "quantum.h"
// readability
#define XXX KC_NO
/* AMJ60 layout to the best of my knowledge matrix layout
* ,-----------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d| 49|
* |-----------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |-----------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d |
* |-----------------------------------------------------------|
* | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c | 3d |
* |-----------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `-----------------------------------------------------------'
*/
#define KEYMAP( \
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, k2c, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) \
{ \
{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, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \
}
/*
* ANSI
* ,-----------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
* |-----------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |-----------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d |
* |-----------------------------------------------------------|
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d |
* |-----------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `-----------------------------------------------------------'
*/
#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 \
) \
{ \
{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, XXX, k2d}, \
{k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
}
/* AMJ60 HHKB matrix layout
* ,------------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d| 49 |
* |------------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |------------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d |
* |------------------------------------------------------------|
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c |
* |------------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `------------------------------------------------------------'
*/
#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 \
) \
{ \
{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, XXX, k2d}, \
{k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \
}
/* ISO
* ,-----------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
* |-----------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |-----------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d |
* |-----------------------------------------------------------|
* | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d |
* |-----------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `-----------------------------------------------------------'
*/
#define KEYMAP_ISO( \
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, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) \
{ \
{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, XXX}, \
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
}
/* ISO w/ split right shift key matrix layout
* ,-----------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
* |-----------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |-----------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d |
* |-----------------------------------------------------------|
* | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c |
* |-----------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `-----------------------------------------------------------'
*/
#define KEYMAP_ISO_SPLITRSHIFT( \
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, k3d, k3c, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) \
{ \
{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, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
}
void matrix_init_user(void);
void matrix_scan_user(void);
#endif

View File

@ -0,0 +1,94 @@
/*
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 0x6066
#define DEVICE_VER 0x0001
#define MANUFACTURER Han Chen
#define PRODUCT AMJ60
#define DESCRIPTION qmk port of AMJ60 PCB
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14
// ROWS: Top to bottom, COLS: Left to right
#define MATRIX_ROW_PINS { F7, F6, F5, F4, D5}
#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7, D6, B3}
#define UNUSED_PINS
#define BACKLIGHT_PIN B6
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* Backlight configuration
*/
#define BACKLIGHT_LEVELS 4
/* Underlight configuration
*/
#define RGB_DI_PIN E2
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 8 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* 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

View File

@ -0,0 +1,23 @@
# 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 = no # 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.
# 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
include ../../../../Makefile
endif

View File

@ -0,0 +1,42 @@
#!/bin/bash
# adjust for cpu
# -j 16 gave best result on a hyperthreaded quad core core i7
LIMIT=10
THREADS="-j 16"
KMAP=iso_split_rshift
echo "We need sudo later"
sudo ls 2>&1 /dev/null
function wait_bootloader {
echo "Waiting for Bootloader..."
local STARTTIME=$(date +"%s")
local REMIND=0
local EXEC=dfu-programmer
local TARGET=atmega32u4
while true
do
sudo $EXEC $TARGET get > /dev/null 2>&1
[ $? -eq 0 ] && break
ENDTIME=$(date +"%s")
DURATION=$(($ENDTIME-$STARTTIME))
if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ]
then
echo "Did you forget to press the reset button?"
REMIND=1
fi
sleep 1
done
}
make clean
make KEYMAP=${KMAP} ${THREADS}
if [[ $? -eq 0 ]]
then
echo "please trigger flashing!"
wait_bootloader
sudo make KEYMAP=${KMAP} dfu ${THREADS}
else
echo "make failed"
exit 77
fi

View File

@ -0,0 +1,147 @@
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
// this is the style you want to emulate.
#include "amj60.h"
// 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 _DEF 0
#define _SPC 1
#define _TAB 2
#define _SFX 3
// dual-role shortcuts
#define TABDUAL LT(_TAB, KC_TAB)
#define CAPSDUAL CTL_T(KC_ESC)
#define SPACEDUAL LT(_SPC, KC_SPACE)
#define ENTERDUAL CTL_T(KC_ENT)
// arrow cluster duality bottom right corner
#define ARRLEFT ALT_T(KC_LEFT)
#define ARRDOWN GUI_T(KC_DOWN)
#define ARRUP SFT_T(KC_UP)
#define ARRRIGHT CTL_T(KC_RIGHT)
// german brackets
#define GER_CUR_L RALT(KC_7) // [
#define GER_CUR_R RALT(KC_0) // ]
#define GER_PAR_L LSFT(KC_8) // (
#define GER_PAR_R LSFT(KC_9) // )
#define GER_ANG_L KC_NUBS // <
#define GER_ANG_R LSFT(KC_NUBS) // >
#define GER_BRC_L RALT(KC_8) // [
#define GER_BRC_R RALT(KC_9) // ]
// increase readability
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _DEF: Default Layer
* ,-----------------------------------------------------------.
* |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1
* |-----------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return |
* |-----------------------------------------------------------|
* |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP
* |-----------------------------------------------------------|
* |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is
* `-----------------------------------------------------------' LEFT DWN RIGHT
*/
[_DEF] = KEYMAP_ISO_SPLITRSHIFT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ARRUP, TG(_SFX), \
KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT),
/* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
* ,-----------------------------------------------------------.
* |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete|
* |-----------------------------------------------------------|
* | |Paus| Up| [ | ] | | | | ( | ) | | | | |
* |-----------------------------------------------------------|
* | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
* |-----------------------------------------------------------|
* | | | | | < | > | |M0 | | | | | Vol+ | |
* |-----------------------------------------------------------|
* | | | | |Alt |Prev|Vol-|Next|
* `-----------------------------------------------------------'
*/
[_SPC] = KEYMAP_ISO_SPLITRSHIFT(
KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
_______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \
_______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \
_______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
/* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab)
* ,-----------------------------------------------------------.
* |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE
* |-----------------------------------------------------------|
* | | | | | | | | | { | } | | | | |
* |-----------------------------------------------------------|
* | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn |
* |-----------------------------------------------------------|
* | | | | | | | |AF2| | | | | PgUp | |
* |-----------------------------------------------------------|
* | | | | |Alt |Pos1|PgDn|End |
* `-----------------------------------------------------------'
*/
[_TAB] = KEYMAP_ISO_SPLITRSHIFT(
KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \
_______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \
_______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \
_______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
/* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key)
* ,-----------------------------------------------------------.
* |RSET| | | | | | | 7| 8| 9| | | |Backsp |
* |-----------------------------------------------------------|
* | | | | | | | | 4 | 5 | 6 | | | | \ |
* |-----------------------------------------------------------|
* | | L | L | | | | | 1 | 2 | 3 | | | Return |
* |-----------------------------------------------------------|
* | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent
* |-----------------------------------------------------------| LED controlling
* |Ctrl|Win |Alt | |Alt |Left|Down|Right|
* `-----------------------------------------------------------'
*/
[_SFX] = KEYMAP_ISO_SPLITRSHIFT(
RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \
_______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \
_______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \
_______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \
_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT),
};
enum function_id {
LAUNCH,
RGBLED_TOGGLE,
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_FUNCTION(LAUNCH),
[10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT),
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
return (record->event.pressed ?
MACRO( D(RALT), T(SPC), U(RALT), END )
:MACRO( END ));
break;
case 1:
return (record->event.pressed ?
MACRO( D(LALT), T(F2), U(LALT), END )
:MACRO( END ));
break;
}
return MACRO_NONE;
};

View File

@ -0,0 +1,30 @@
toneman77's custom spacefn Layout
=====================
##Quantum MK Firmware
For the full Quantum feature list, see the parent readme.md.
# Features
* heavily modified ISO (!) layout with split right shift key
* spaceFn
* Dual-Role keys:
*
| Original key | when tapped | when held |
| ---------------- | ------------- | ------------- |
| Space | Space | layer change |
| Caps lock | Escape | Control |
| Tab | Tab | layer change |
| Enter | Enter | Control |
* vim-style arrow keys on hjkl (spacefn layer)
* corresponding Home/PgDn/PgUp/End on hjkl (tab layer)
* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift
* more bonus arrow keys on wasd (spacefn layer)
* media keys prev/next/play/vol+/vol- (spacefn layer)
* firmware bootloader button
* additional brackets that only work in german layout due to horrible placement
in the default qwertz layout
### Additional Credits
* visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) (without the LED keys)

View File

@ -0,0 +1,4 @@
#!/bin/bash
git checkout amj60 # gets you on branch amj60
git fetch origin # gets you up to date with origin
git merge origin/master

View File

@ -0,0 +1,57 @@
AMJ60 keyboard firmware
======================
DIY/Assembled compact 60% keyboard.
## 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/amj60
folder. Once your dev env is setup, you'll be able to type `make` to generate
your .hex - you can then use `make dfu` to program your PCB once you hit the
reset button.
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.
## Variations
KEYMAP macros for the following layouts are available:
* default, for all the available, possible keys
* ANSI, for 60% ANSI keyboard
* ISO
* ISO w/ split right shift key
* HHKB
Remark: all but "ISO w/ split right shift key" are untested and were done to the best of my knowledge.
### Original tmk firmware
The original firmware that was used to port to qmk can be found [here](https://github.com/AMJKeyboard/AMJ60).
## Further information
Since information and documentation for this board are sparse, (at least for non-chinese speaking ppl) here is everything that could be found
* [geekhack discussion](https://geekhack.org/index.php?topic=53070.0)
* [chinese discussion](https://www.v2ex.com/t/161887)
* Board has [dedicated pinouts](https://i.imgur.com/D0sWhyh.jpg?1) for a bluetooth module
* has pins for external power [picture](https://i.imgur.com/00VrtIp.jpg?1).
* most information comes from [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/32oonr/gh60_pcb_for_your_custom_keyboard/)

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,113 @@
arrow_pad keyboard firmware
======================
## Keyboard Info
The ArrowPad is a wired conversion that can be made to any stand-alone keypad. It uses two main layers - a standard numpad, and a more advanced arrow cluster navigator.
The first 24-key ArrowPad was handwired, but the PCB was wired as listed below.
```
<Chip Ref Des> pin <Pin #>
<Keycap Name> (Silkscreen Name if different) - <Switch Pin #>
Note:
U2 pin 2 is the Num Lock LED and is active low.
U2 pin 1
Clear (Num Lock) - 1
Enter - 2
Esc (ESC) - 2
U2 pin 3
- - 1
U2 pin 4
7 - 2
8 - 2
9 - 2
U2 pin 5
* - 2
Delete (BACK SPACE) - 2
U2 pin 6
1 - 2
0 - 2
. - 2
, - 2
U2 pin 7
4 - 2
5 - 2
6 - 2
U2 pin 8
Tab - 2
= (/) - 2
U2 pin 13
Delete (BACK SPACE) - 1
9 - 1
6 - 1
3 - 1
. - 1
U2 pin 14
Tab - 1
8 - 1
5 - 1
2 - 1
0 - 1
U2 pin 15
Esc (ESC) - 1
= (/) - 1
/ (*) - 1
7 - 1
4 - 1
1 - 1
+ - 1
U2 pin 16
Enter - 1
* (<--) - 1
, - 1
U2 pin 17
Fn (#NAME?) - 1
- - 2
Clear (Num Lock) - 2
U2 pin 18
Fn (#NAME?) - 2
* (<--) - 2
+ - 2
3 - 2
2 - 2
```
More info can be found on [GeekHack](https://geekhack.org/index.php?topic=73632.msg1802497#msg1802497)
The second ArrowPad was a conversion from a 21-key Genovation keypad. It used a 2 row x 11 column matrix.
```
#define KEYMAP( \
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
KM___7, KM___8, KM___9, ___PLS, \
KM___4, KM___5, KM___6, KM_PLS, \
KM___1, KM___2, KM___3, ___ENT, \
KM___0, _____0, KM_DOT, KM_ENT \
) { \
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
{ KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
}
```
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme.md](/readme.md).
@ -12,13 +119,15 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol
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`.
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 `KEYMAP` option like:
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make KEYMAP=[default|jack|<name>]
$ make [default|pad_21|pad_24|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View File

@ -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

View File

@ -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

View File

@ -1,7 +1,7 @@
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
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)
CONSOLE_ENABLE = yes # 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 = yes # Enable keyboard backlight functionality

View File

@ -150,10 +150,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* disable debug print */
//#define NO_DEBUG
#ifndef NO_DEBUG
# define NO_DEBUG
#endif
/* disable print */
//#define NO_PRINT
// #ifndef NO_PRINT
// # define NO_PRINT
// #endif
/* Only print user print statements */
#define USER_PRINT
/* disable action features */
//#define NO_ACTION_LAYER

View File

@ -2,48 +2,59 @@
#include "action_layer.h"
#include "eeconfig.h"
#include "led.h"
#include "mousekey.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#include "song_list.h"
#endif
#define LAYER_QWERTY 0
#define LAYER_COLEMAK 1
#define LAYER_DVORAK 2
#define LAYER_UPPER 3
#define LAYER_LOWER 4
#define LAYER_FUNCTION 5
#define LAYER_MOUSE 6
#define LAYER_ADJUST 7
#define MACRO_QWERTY 0
#define MACRO_COLEMAK 1
#define MACRO_DVORAK 2
#define MACRO_UPPER 3
#define MACRO_LOWER 4
#define MACRO_FUNCTION 5
#define MACRO_MOUSE 6
#define MACRO_TIMBRE_1 7
#define MACRO_TIMBRE_2 8
#define MACRO_TIMBRE_3 9
#define MACRO_TIMBRE_4 10
#define MACRO_TEMPO_U 11
#define MACRO_TEMPO_D 12
#define MACRO_TONE_DEFAULT 13
#define MACRO_MUSIC_TOGGLE 14
#define MACRO_AUDIO_TOGGLE 16
#define MACRO_INC_VOICE 18
#define MACRO_DEC_VOICE 19
#define MACRO_BACKLIGHT 20
#define MACRO_BREATH_TOGGLE 21
#define MACRO_BREATH_SPEED_INC 23
#define MACRO_BREATH_SPEED_DEC 24
#define MACRO_BREATH_DEFAULT 25
enum keyboard_layers {
LAYER_QWERTY = 0,
LAYER_UPPER,
LAYER_LOWER,
LAYER_FUNCTION,
LAYER_MOUSE,
LAYER_ADJUST,
};
enum keyboard_macros {
MACRO_QWERTY = 0,
MACRO_UPPER,
MACRO_LOWER,
MACRO_FUNCTION,
MACRO_MOUSE,
MACRO_TIMBRE_1,
MACRO_TIMBRE_2,
MACRO_TIMBRE_3,
MACRO_TIMBRE_4,
MACRO_TEMPO_U,
MACRO_TEMPO_D,
MACRO_TONE_DEFAULT,
MACRO_MUSIC_TOGGLE,
MACRO_AUDIO_TOGGLE,
MACRO_INC_VOICE,
MACRO_DEC_VOICE,
MACRO_BACKLIGHT,
MACRO_BREATH_TOGGLE,
MACRO_BREATH_SPEED_INC,
MACRO_BREATH_SPEED_DEC,
MACRO_BREATH_DEFAULT,
MACRO_MOUSE_MOVE_UL,
MACRO_MOUSE_MOVE_UR,
MACRO_MOUSE_MOVE_DL,
MACRO_MOUSE_MOVE_DR,
MACRO_HELP_1,
MACRO_HELP_2,
MACRO_HELP_3,
MACRO_HELP_4,
MACRO_HELP_5,
MACRO_HELP_6,
MACRO_HELP_7,
MACRO_HELP_8,
MACRO_HELP_9,
};
#define M_QWRTY M(MACRO_QWERTY)
#define M_COLMK M(MACRO_COLEMAK)
#define M_DVORK M(MACRO_DVORAK)
#define M_UPPER M(MACRO_UPPER)
#define M_LOWER M(MACRO_LOWER)
#define M_FUNCT M(MACRO_FUNCTION)
@ -60,6 +71,19 @@
#define M_BSPDU M(MACRO_BREATH_SPEED_INC)
#define M_BSPDD M(MACRO_BREATH_SPEED_DEC)
#define M_BDFLT M(MACRO_BREATH_DEFAULT)
#define M_MS_UL M(MACRO_MOUSE_MOVE_UL)
#define M_MS_UR M(MACRO_MOUSE_MOVE_UR)
#define M_MS_DL M(MACRO_MOUSE_MOVE_DL)
#define M_MS_DR M(MACRO_MOUSE_MOVE_DR)
#define M_HELP1 M(MACRO_HELP_1)
#define M_HELP2 M(MACRO_HELP_2)
#define M_HELP3 M(MACRO_HELP_3)
#define M_HELP4 M(MACRO_HELP_4)
#define M_HELP5 M(MACRO_HELP_5)
#define M_HELP6 M(MACRO_HELP_6)
#define M_HELP7 M(MACRO_HELP_7)
#define M_HELP8 M(MACRO_HELP_8)
#define M_HELP9 M(MACRO_HELP_9)
#define VC_UP M(MACRO_INC_VOICE)
@ -77,6 +101,7 @@
#define SC_ACLS LALT(KC_F4)
#define SC_CCLS LCTL(KC_F4)
#define TG_NKRO MAGIC_TOGGLE_NKRO
#define OS_SHFT KC_FN0
#define _______ KC_TRNS
@ -86,155 +111,126 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_QWERTY] = { // QWERTY
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* COLEMAK
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | BACKSP | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_COLEMAK] = { // COLEMAK
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* DVORAK
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAPS | A | O | E | U | I | D | H | T | N | S | - | XXXXXX . ENTER | PG UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LWIN | FN | LALT | UPPER | XXXXXX . SPACE | LOWER | SHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_DVORAK] = { // DVORAK
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_BSPC },
{ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL },
{ KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_ENT, KC_PGUP },
{ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC, KC_SPC, M_LOWER, OS_SHFT, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
},
/* UPPER
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | PRINT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | NUM LK | / | * | | NUM LK | SCR LK | XXXXXX . PAUSE |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | F1 | F2 | F3 | F4 | | | 7 | 8 | 9 | - | | | | INS |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | CAP LK | F5 | F6 | F7 | F8 | | | 4 | 5 | 6 | + | | XXXXXX . | HOME |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | | F9 | F10 | F11 | F12 | | | 1 | 2 | 3 | ENTER | XXXXXX . | | END |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | 0 | | RALT | . | ENTER | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_UPPER] = { // UPPER
{ KC_PSCR, M_BRTOG, M_BSPDU, M_BSPDD, M_BDFLT, XXXXXXX, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, XXXXXXX, XXXXXXX, KC_SLCK, KC_PAUS, KC_PAUS },
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, KC_INS },
{ KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, ________________, KC_HOME },
{ _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, ________________, _______, KC_END },
{ _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, _______, _______, _______, _______ },
},
/* LOWER
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | XXXXXX . BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | $ | { | [ | ( | % | # | ) | ] | } | @ | | | | INS |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
* | | ^ | * | + | - | ; | : | _ | ' | " | ` | | XXXXXX . | HOME |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
* | | | | & | ! | ~ | / | \ | = | < | > | ? | XXXXXX . | | END |
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | | | | | | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_LOWER] = { // LOWER
{ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ },
{ _______, KC_DLR, KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT, _______, _______, _______, KC_INS },
{ _______, KC_CIRC, KC_ASTR, KC_PPLS, KC_PMNS, KC_SCLN, KC_COLN, KC_UNDS, KC_QUOT, KC_DQT, KC_GRV, _______, ________________, KC_HOME },
{ _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SLSH, KC_BSLS, KC_EQL, KC_LT, KC_GT, KC_QUES, ________________, _______, KC_END },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ },
},
[LAYER_FUNCTION] = { // FUNCTION
{ KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ },
{ KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS },
{ KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_PSCR },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_VOLU, KC_MUTE },
{ _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT },
},
#ifdef MOUSEKEY_ENABLE
[LAYER_MOUSE] = { // MOUSE
{ _______, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXX, KC_WH_U },
{ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ________________, KC_MS_U, KC_WH_D },
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
},
#endif
[LAYER_ADJUST] = { // ADJUST
{ _______, TIMBR_1, TIMBR_2, TIMBR_3, TIMBR_4, TMPO_UP, TMPO_DN, TMPO_DF, _______, _______, _______, MU_TOG, AU_TOG, ________________ },
{ _______, M_QWRTY, M_COLMK, M_DVORK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ },
{ _______, _______, _______, _______, M_BACKL, RESET, _______, M_MOUSE, _______, _______, _______, ________________, MUV_IN, _______ },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, MUV_DE, _______ },
},
/*
[LAYER_EMPTY] = { // LAYER
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______, _______ },
{ _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ },
},
/* LAYER = LAYER_QWERTY
.--------------------------------------------------------------------------------------------------------------------------------------.
| ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP . BACKSP |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER . ENTER | PG UP |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT . RSHIFT | UP | PG DN |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| LCTRL | LWIN | FN | LALT | UPPER | SPACE . SPACE | LOWER | OSHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_QWERTY] = {
{ KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_BSPC },
{ KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
{ KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_ENT , KC_PGUP },
{ KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_RSFT, KC_UP , KC_PGDN },
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC , KC_SPC , M_LOWER, OS_SHFT, KC_RALT, KC_APP , KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }
},
/* LAYER = LAYER_UPPER
.--------------------------------------------------------------------------------------------------------------------------------------.
| PRINT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | NUM LK | KP / | KP * | KP - | XXXXXX | XXXXXX | ______ . ______ |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| PAUSE | F1 | F2 | F3 | F4 | NUM LK | KP / | KP 7 | KP 8 | KP 9 | KP - | ______ | ______ | ______ | INS |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | F5 | F6 | F7 | F8 | CAP LK | KP * | KP 4 | KP 5 | KP 6 | KP + | ______ | ______ . ______ | HOME |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | F9 | F10 | F11 | F12 | SCR LK | KP 0 | KP 1 | KP 2 | KP 3 | KP ENT | ______ . ______ | ______ | END |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | ______ | ______ | ______ | UPPER | KP 0 . KP 0 | ______ | RALT | KP . | KP ENT | ______ | ______ | ______ | ______ |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_UPPER] = {
{ KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, _______, _______ },
{ KC_PAUS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NLCK, KC_PSLS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, KC_INS },
{ _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_CAPS, KC_PAST, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, KC_HOME },
{ _______, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_SLCK, KC_KP_0, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, _______, _______, KC_END },
{ _______, _______, _______, _______, M_UPPER, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, _______, _______, _______, _______ }
},
/* LAYER = LAYER_LOWER
.--------------------------------------------------------------------------------------------------------------------------------------.
| PRINT | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ______ . ______ |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | $ | { | [ | ( | % | # | ) | ] | } | @ | ______ | ______ | ______ | INS |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | ^ | * | + | - | / | \ | _ | ' | " | ` | ______ | ______ . ______ | HOME |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | | | & | ! | ~ | ; | : | = | < | > | ? | ______ . ______ | ______ | END |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | ______ | ______ | ______ | ______ | ______ . ______ | LOWER | ______ | ______ | ______ | ______ | ______ | ______ | ______ |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_LOWER] = {
{ KC_PSCR, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______ },
{ _______, KC_DLR , KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT , _______, _______, _______, KC_INS },
{ _______, KC_CIRC, KC_ASTR, KC_PLUS, KC_MINS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT , KC_GRV , _______, _______, _______, KC_HOME },
{ _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL , KC_LT , KC_GT , KC_QUES, _______, _______, _______, KC_END },
{ _______, _______, _______, _______, _______, _______, _______, M_LOWER, _______, _______, _______, _______, _______, _______, _______ }
},
/* LAYER = LAYER_FUNCTION
.--------------------------------------------------------------------------------------------------------------------------------------.
| XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | F13 | F14 | F15 | F16 | NUM LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | F17 | F18 | F19 | F20 | SCR LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | F21 | F22 | F23 | F24 | CAP LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | ______ . ______ | VOL UP | MUTE |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | ______ | FN | ______ | ______ | PLAY . PLAY | ______ | ______ | ______ | ______ | ______ | PREV | VOL DN | NEXT |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_FUNCTION] = {
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ _______, KC_F21 , KC_F22 , KC_F23 , KC_F24 , KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_VOLU, KC_MUTE },
{ _______, _______, M_FUNCT, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT }
},
/* LAYER = LAYER_MOUSE
.--------------------------------------------------------------------------------------------------------------------------------------.
| ESC | MS AC0 | MS AC1 | MS AC2 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MS UL | MS U | MS UR | XXXXXX | XXXXXX | XXXXXX | MS WHL | MS WHR |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | MS BT5 | MS BT4 | MS BT3 | MS BT2 | XXXXXX | XXXXXX | MS L | XXXXXX | MS R | XXXXXX | XXXXXX | XXXXXX . XXXXXX | MS WHU |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MS DL | MS D | MS DR | XXXXXX | ______ . ______ | MS U | MS WHD |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| ______ | ______ | ______ | ______ | ______ | MS BT1 . MS BT1 | ______ | ______ | ______ | ______ | ______ | MS L | MS D | MS R |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_MOUSE] = {
{ KC_ESC , KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_MS_UL, KC_MS_U, M_MS_UR, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_R },
{ XXXXXXX, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, KC_MS_L, XXXXXXX, KC_MS_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_U },
{ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_MS_DL, KC_MS_D, M_MS_DR, XXXXXXX, _______, _______, KC_MS_U, KC_WH_D },
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }
},
/* LAYER = LAYER_ADJUST
.--------------------------------------------------------------------------------------------------------------------------------------.
| XXXXXX | HELP 1 | HELP 2 | HELP 3 | HELP 4 | HELP 5 | HELP 6 | HELP 7 | HELP 8 | HELP 9 | XXXXXX | MUSIC | AUDIO | XXXXXX . XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | BRTOG | BRSPD+ | BRSPD- | BRDFLT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | QWERTY | XXXXXX | XXXXXX | BACKLT | RESET | XXXXXX | MOUSE | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | VOICE+ | XXXXXX |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| XXXXXX | XXXXXX | XXXXXX | XXXXXX | UPPER | XXXXXX . XXXXXX | LOWER | XXXXXX | XXXXXX | XXXXXX | XXXXXX | TEMPO- | VOICE- | TEMPO+ |
'--------------------------------------------------------------------------------------------------------------------------------------'
*/
[LAYER_ADJUST] = {
{ XXXXXXX, M_HELP1, M_HELP2, M_HELP3, M_HELP4, M_HELP5, M_HELP6, M_HELP7, M_HELP8, M_HELP9, XXXXXXX, MU_TOG , AU_TOG , XXXXXXX, XXXXXXX },
{ XXXXXXX, M_BRTOG, M_BSPDU, M_BSPDD, M_BDFLT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX },
{ XXXXXXX, M_QWRTY, XXXXXXX, XXXXXXX, M_BACKL, RESET , XXXXXXX, M_MOUSE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MUV_IN , XXXXXXX },
{ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_UPPER, XXXXXXX, XXXXXXX, M_LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TMPO_DN, MUV_DE , TMPO_UP }
},
};
#ifdef AUDIO_ENABLE
@ -276,6 +272,69 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id)
{
case MACRO_HELP_1:
if (record->event.pressed)
{
uprintf("1");
}
break;
case MACRO_HELP_2:
if (record->event.pressed)
{
uprintf("2");
}
break;
case MACRO_HELP_3:
if (record->event.pressed)
{
uprintf("3");
}
break;
case MACRO_HELP_4:
if (record->event.pressed)
{
uprintf("4");
}
break;
case MACRO_HELP_5:
if (record->event.pressed)
{
uprintf("5");
}
break;
case MACRO_HELP_6:
if (record->event.pressed)
{
uprintf("6");
}
break;
case MACRO_HELP_7:
if (record->event.pressed)
{
uprintf("7");
}
break;
case MACRO_HELP_8:
if (record->event.pressed)
{
uprintf("8");
}
break;
case MACRO_HELP_9:
if (record->event.pressed)
{
uprintf("9");
}
break;
case MACRO_BREATH_TOGGLE:
if (record->event.pressed)
{
@ -308,29 +367,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_QWERTY);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;
case MACRO_COLEMAK:
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_COLEMAK);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;
case MACRO_DVORAK:
if (record->event.pressed)
{
persistant_default_layer_set(1UL<<LAYER_DVORAK);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, STACCATO);
#endif /* AUDIO_ENABLE */
}
break;

View File

@ -13,13 +13,14 @@ Download or clone the whole firmware and navigate to the keyboards/atomic folder
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`.
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 a file in the keymaps folder named `<name>.c` 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:
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make KEYMAP=[default|jack|<name>]
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View File

@ -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

View File

@ -1,88 +1,3 @@
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
ifndef QUANTUM_DIR
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif
USB ?= /dev/cu.usbmodem1411
upload: build
$(ATRUES_UPLOAD_COMMAND)

View File

@ -12,14 +12,14 @@
#define KEYMAP( \
k00, 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, k2a, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, KC_NO, k05, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, KC_NO, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, k24, k35, k25, k26, k27, k28, k29 }, \
{ k2a, k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a } \
{ k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b } \
}
#endif

View File

@ -37,7 +37,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// COLS: Left to right, ROWS: Top to bottom
#if defined(ATREUS_ASTAR)
# define MATRIX_ROW_PINS { D0, D1, D3, D2 }
#if defined(PCBDOWN)
# define MATRIX_COL_PINS { B7, D6, F7, F6, B6, D4, E6, B4, B5, C6, D7 }
#else
# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 }
#endif
# define UNUSED_PINS
#elif defined(ATREUS_TEENSY2)
# define MATRIX_ROW_PINS { D0, D1, D2, D3 }

View File

@ -0,0 +1,80 @@
/*
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 Arbitrary Definitions
#define PRODUCT Planckeus
#define DESCRIPTION q.m.k. keyboard firmware for Planckeus
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 11
#define MATRIX_ROW_PINS { D0, D1, D2, D3 }
#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, F7, B0, B1, B2, B3, B7 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* 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

View File

@ -0,0 +1,45 @@
#include "atreus.h"
#define BASE 0
#define SYMB 1
#define ETC 2
enum macro_id {
TEENSY,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(
KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_SCLN,
LT(ETC,KC_A), KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H,
SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH),
KC_GRV, KC_DEL, KC_LALT, GUI_T(KC_TAB), LT(SYMB,KC_BSPC), CTL_T(KC_ESC), SFT_T(KC_ENT), LT(SYMB,KC_SPC), GUI_T(KC_LEFT), KC_DOWN, KC_UP, LCAG_T(KC_RGHT)
),
[SYMB] = KEYMAP(
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_EQL, KC_7, KC_8, KC_9, KC_PLUS,
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BSLS, KC_MINS, KC_4, KC_5, KC_6, KC_QUOT,
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_ASTR, KC_UNDS, KC_1, KC_2, KC_3, KC_DQUO,
KC_TILD, KC_AMPR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_NO, KC_DOT, KC_TRNS
),
[ETC] = KEYMAP(
RESET, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_VOLU, KC_F7, KC_F8, KC_F9, KC_HOME,
LT(ETC,KC_A), KC_NO, KC_NO, KC_NO, KC_PGDN, KC_VOLD, KC_F4, KC_F5, KC_F6, KC_END,
KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, KC_MUTE, KC_F1, KC_F2, KC_F3, KC_INS,
KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO
),
};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) {
case TEENSY:
break;
}
return MACRO_NONE;
};

View File

@ -0,0 +1,48 @@
#include "atreus.h"
// 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 _QW 0
#define _RS 1
#define _LW 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = { /* Qwerty */
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN },
{KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH },
{KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT }
},
[_RS] = { /* [> RAISE <] */
{KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR},
{KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS},
{KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_LALT, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS},
{TG(_LW), KC_INS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL}
},
[_LW] = { /* [> LOWER <] */
{KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10},
{KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LALT, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12},
{KC_TRNS, KC_TRNS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, DF(_QW), KC_TRNS, KC_TRNS, RESET}
}};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View File

@ -18,17 +18,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH },
{KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT }
},
/*
* ! @ up { } || pgup 7 8 9 *
* # left down right $ || pgdn 4 5 6 +
* [ ] ( ) & || ` 1 2 3 \
* lower insert super shift bksp ctrl || alt space fn . 0 =
*/
[_RS] = { /* [> RAISE <] */
{KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR},
{KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS},
{KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_LALT, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS},
{KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_TRNS, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR},
{KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_TRNS, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS},
{KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_LALT, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS},
{TG(_LW), KC_INS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL}
},
/*
* insert home up end pgup || up F7 F8 F9 F10
* del left down right pgdn || down F4 F5 F6 F11
* volup reset || F1 F2 F3 F12
* voldn super shift bksp ctrl || alt space L0 prtsc scroll pause
*/
[_LW] = { /* [> LOWER <] */
{KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10},
{KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LALT, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12},
{KC_TRNS, KC_TRNS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, DF(_QW), KC_TRNS, KC_TRNS, RESET}
{KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, RESET, KC_LALT, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12},
{KC_TRNS, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_SPC, DF(_QW), KC_PSCR, KC_SLCK, KC_PAUS}
}};
const uint16_t PROGMEM fn_actions[] = {

View File

@ -0,0 +1,96 @@
/*
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"
/* Make Overloaded Keys switch faster */
#define TAPPING_TERM 150
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER Technomancy
#define PRODUCT Atreus
#define DESCRIPTION q.m.k. keyboard firmware for Atreus
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 11
// Change this to how you wired your keyboard
// COLS: Left to right, ROWS: Top to bottom
#if defined(ATREUS_ASTAR)
# define MATRIX_ROW_PINS { D0, D1, D3, D2 }
#if defined(PCBDOWN)
# define MATRIX_COL_PINS { B7, D6, F7, F6, B6, D4, E6, B4, B5, C6, D7 }
#else
# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 }
#endif
# define UNUSED_PINS
#elif defined(ATREUS_TEENSY2)
# define MATRIX_ROW_PINS { D0, D1, D2, D3 }
# define MATRIX_COL_PINS { F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0 }
# define UNUSED_PINS
#endif
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* 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

View File

@ -0,0 +1,61 @@
// this is the style you want to emulate.
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
#include "atreus.h"
// 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 BASE 0
#define NUMS 1
#define MOUS 2
// Some quick aliases, just to make it look pretty
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP( /* Qwerty */
KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,
KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN ,
SFT_T(KC_Z), KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , SFT_T(KC_QUOT),
KC_LCTL , KC_LALT, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC, KC_ENT, KC_SPC, F(NUMS), KC_RALT, KC_SLSH, KC_BSLS ),
[NUMS] = KEYMAP( /* Numbers / Arrows / Symbols */
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_LPRN, KC_RPRN, KC_MINS, KC_EQL , KC_LBRC,
KC_TAB , KC_5 , KC_6 , KC_7 , KC_8 , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_RBRC,
_______, KC_9 , KC_0 , KC_DOT , KC_COMM, KC_HOME, KC_PGDN, KC_PGUP, KC_END , _______,
_______, _______, _______, _______, KC_DEL , F(MOUS), _______, _______, _______, _______, _______, _______),
[MOUS] = KEYMAP( /* Mouse and Media Keys */
KC_SLCK, KC_PAUSE, KC_F11 , KC_F10 , KC_F9 , KC_F8 , KC_F7 , KC_F6 , KC_F5 , KC_F4,
KC_VOLD, KC_ACL0 , KC_ACL1, KC_ACL2, KC_VOLU, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_F3,
KC_MUTE, KC_MPRV , KC_MPLY, KC_MNXT, KC_MUTE, KC_WH_R, KC_WH_U, KC_WH_D, KC_WH_L, KC_F2,
_______, _______ , _______, _______, _______, _______, _______, KC_BTN1, F(BASE), RESET , KC_F12 , KC_F1)
};
// I prefer this layer switching strategy to the TG and MO functions.
// so that I can get out of mouse mode just by tapping/holding my base layer FN key.
const uint16_t PROGMEM fn_actions[] = {
[BASE] = ACTION_LAYER_OFF(2, 1), // switch back to layer 0
[NUMS] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
[MOUS] = ACTION_LAYER_ON(2, 1) // switch to layer 2
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View File

@ -0,0 +1,66 @@
// This is the personal keymap of Jeremy Cowgar (@jcowgar). It is written for the programmer.
#include "atreus.h"
#include "action_layer.h"
#include "keymap_colemak.h"
#define PREVENT_STUCK_MODIFIERS
// Each layer gets a name for readability, which is then used in the keymap matrix below.
#define ALPH 0
#define NUMS 1
#define CURS 2
#define SYMB 3
#define FKEY 4
// Some handy macros to keep the keymaps clean and easier to maintain
#define KM_SAVE LGUI(CM_S)
#define KM_CLSE LGUI(CM_W)
#define KM_OPEN LGUI(CM_O)
#define KM_COPY LGUI(KC_C)
#define KM_CUT LGUI(KC_X)
#define KM_PAST LGUI(KC_V)
#define KM_UNDO LGUI(KC_Z)
#define KM_REDO LGUI(LSFT(KC_Z))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[ALPH] = {
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P},
{KC_A, LT(NUMS, KC_S), LT(FKEY, KC_D), KC_F, KC_G, KC_TRNS, KC_H, KC_J, LT(CURS, KC_K), LT(SYMB, KC_L), KC_SCLN},
{KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
{KC_LCTL, KC_ESC, KC_NO, KC_LSFT, KC_SPC, KC_LGUI, KC_ENT, KC_RSFT, KC_NO, KC_ESC, KC_RCTL}
},
[NUMS] = {
{KC_TRNS, KC_TRNS, KC_TRNS, KC_ASTR, KC_SLSH, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_SLSH},
{KC_TRNS, KC_TRNS, KC_EQL, KC_PLUS, KC_MINS, KC_TRNS, KC_LPRN, KC_4, KC_5, KC_6, KC_ASTR},
{KC_TRNS, KC_TRNS, KC_DOT, KC_COMM, CM_SCLN, KC_TRNS, KC_RPRN, KC_1, KC_2, KC_3, KC_MINS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_EQL, KC_PLUS}
},
[CURS] = {
{KC_TRNS, KC_BSPC, KC_UP, KC_DELT, KC_PGUP, KC_TRNS, KC_TRNS, KM_SAVE, KC_TRNS, KM_OPEN, KC_TRNS},
{KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KM_UNDO, KC_LALT, KC_TRNS, KC_LGUI, KC_TRNS},
{KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_MPLY, KM_COPY, KM_REDO, KM_CLSE, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TAB, KM_CUT, KM_PAST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
},
[SYMB] = {
{KC_BSLS, KC_EXLM, KC_LABK, KC_RABK, CM_COLN, KC_TRNS, KC_UNDS, KC_DLR, KC_QUES, KC_TRNS, KC_PERC},
{KC_AT, KC_AMPR, KC_LPRN, KC_RPRN, CM_SCLN, KC_TRNS, KC_COMM, KC_DOT, KC_QUOT, KC_TRNS, KC_TILD},
{KC_HASH, KC_PIPE, KC_LCBR, KC_RCBR, KC_SLSH, KC_TRNS, KC_TRNS, KC_GRV, KC_DQT, KC_TRNS, KC_CIRC},
{KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
},
[FKEY] = {
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
}};
const uint16_t PROGMEM fn_actions[] = {};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {}
return MACRO_NONE;
};

View File

@ -0,0 +1,45 @@
Jeremy's Atreus Key Mapping
===========================
I am a programmer by trade that suffers from the beginning stages of RSI. As a programmer I use letters, symbols and cursor navigation most often. To prevent strange finger gymnastics, I wrote a script to rank which non-letter characters occurred in my primary source projects most often and then placed these characters in the easiest to reach locations, for me. I made heavy use of momentary layer toggling.
My layout is also geared toward a software based Colemak mapping. I would like it to be hardware, but I use my Laptop on the go frequently and thus my laptop keyboard. I have moved the keycaps to reflect the Colemak layout. My laptop is a MacBook Pro (2015).
## Main Layers
1. [Letters](http://www.keyboard-layout-editor.com/#/gists/6861cb9df09ce78efaddf8aa7471e3ac)
2. [Symbols](http://www.keyboard-layout-editor.com/#/gists/8956a18b508a78e93b9c38ec3fcccaa5)
3. [Navigation](http://www.keyboard-layout-editor.com/#/gists/6ed492b714a7f54eb1c5de09b87fd8c4)
4. [Numbers](http://www.keyboard-layout-editor.com/#/gists/399ceb5624e8388e48a3a5eacac8e973)
5. [Function Keys](http://www.keyboard-layout-editor.com/#/gists/7fd7dc24c7048316f3724b1893c64e89)
## Notes
### General
Some characters can be accessed multiple ways. This was done because you may be in a given layer, such as numbers, where when doing math, you may need quick access to the parentheses characters for grouping. This prevents some layer switching.
I own an ErgoDox and plan on porting this as a base layer, then using the extra keys the ErgoDox provides accordingly. My goal, though, is to be fully functional on this base setup and build everything into muscle memory.
### Symbol Layer
1. I placed characters that deal with an if statement close together, such as !, & and |.
2. All matching brace/bracket characters are together as well.
### Number Layer
1. Everything I did was a compromise when trying to mimic a ten-key. I did the best I could.
2. Operators are duplicated on the right and left. I do not find it comfortable to use my pinky much, so I tend to use my left hand for +, -, * and / but those were also placed on the right hand to mimic the ten-key.
3. Parentheses were added for typing on the calculator.
### Cursor Layer
1. It includes basic audio controls because they didn't really fit anywhere else
2. It contains basic file manipulation. I'm not sure that was a good idea. I do save all the time, but Cmd+S isn't exactly hard.
3. It contains the backspace and delete keys right on top of the left and right arrows.
4. Cmd and Opt keys are duplicated. This makes for very easy navigation, for example on a Mac, Opt+Left/Right moves word by word. It also backspaces or deletes word by word.
### Function Layer
1. Almost all other layers I saw grouped the F keys into a bunch of three. This only gives nine function keys in order if you attempt to stay as close to the home row as possible. I went with a group of four, which gives all twelve function keys to the right hand, one row below and above the home row.
2. I duplicated the Command and Option keys the same as on the cursor layer. This makes it dead easy to hit modified function keys such as Cmd+Opt+F5. It's also easy to toss in a Shift modifier in there with the right thumb since the bottom row is preserved.

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,94 @@
/*
Config file - Atreus QMK with replicaJunction layout
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 Technomancy
#define PRODUCT Atreus
#define DESCRIPTION q.m.k. keyboard firmware for Atreus
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 11
// Change this to how you wired your keyboard
// COLS: Left to right, ROWS: Top to bottom
#if defined(ATREUS_ASTAR)
# define MATRIX_ROW_PINS { D0, D1, D3, D2 }
# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 }
# define UNUSED_PINS
#elif defined(ATREUS_TEENSY2)
# define MATRIX_ROW_PINS { D0, D1, D2, D3 }
# define MATRIX_COL_PINS { F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0 }
# define UNUSED_PINS
#endif
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
// Default: 5
#define DEBOUNCING_DELAY 6
// I don't have any locking keys, so I don't need these features
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* Prevent modifiers from sticking when switching layers */
#define PREVENT_STUCK_MODIFIERS
/*
* 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

View File

@ -0,0 +1,107 @@
/*
* Keyboard: Atreus
* Keymap: replicaJunction
* Version: 0.3
*
* This keymap is designed to complement my Ergodox keyboard layout, found in keyboards/ergodox_ez.
* The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. I now
* have both keyboards, so I've designed these layouts in an effort to make switching between the
* two as easy as possible.
*
* Clearly, the Atreus is the limiting factor in this equation, so I've taken heavy advantage of
* function and dual-role keys.
*
* The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found
* here: https://colemakmods.github.io/mod-dh/
*/
#include "atreus.h"
// 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.
// Note that whatever is set as layer 0 will be the default layer of the keyboard.
#define _CO 0 // Colemak
#define _QW 1 // QWERTY
#define _GA 2 // Gaming
#define _EX 3 // Extend
#define _NU 4 // Numpad
#define _FN 5 // Function
// Some quick aliases, just to make it look pretty
#define _______ KC_TRNS
#define KCX_CA LCTL(KC_LALT)
#define KCX_CS LCTL(KC_LSFT)
#define KCX_CSA LCTL(LSFT(KC_LALT))
#define KCX_LST LSFT(KC_TAB)
#define KX_COPY LCTL(KC_C)
#define KX_CUT LCTL(KC_X)
#define KX_PAST LCTL(KC_V)
#define KX_UNDO LCTL(KC_Z)
; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_CO] = KEYMAP(
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O,
SFT_T(KC_Z), KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SFT_T(KC_SLSH),
KC_ESC, KC_LGUI, KC_TAB, KC_LALT, KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL
),
[_QW] = KEYMAP( /* Qwerty */
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH),
KC_ESC, KC_LGUI, KC_TAB, KC_LALT, KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL
),
[_EX] = KEYMAP( /* Extend */
KC_CAPS, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL,
_______, KC_LGUI, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC,
_______, KX_CUT, KX_COPY, _______, KX_PAST, _______, KC_TAB, KCX_LST, _______, KC_INSERT,
_______, _______, _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, KC_PSCR
),
[_NU] = KEYMAP( /* Numbers and symbols */
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR,
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, KC_PIPE, KC_4, KC_5, KC_6, KC_MINS,
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, KC_BSLS, KC_1, KC_2, KC_3, KC_PLUS,
_______, TG(_GA), _______, MO(_FN), _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, _______
),
[_FN] = KEYMAP( /* Functions */
KC_DEL, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, KC_F7, KC_F8, KC_F9, KC_F10,
KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, _______, KC_F4, KC_F5, KC_F6, KC_F11,
_______, KC_VOLU, KC_MUTE, KC_VOLD, KC_MPLY, _______, KC_F1, KC_F2, KC_F3, KC_F12,
_______, _______, _______, _______, KC_MSTP, _______, _______, _______, KC_NO, DF(_CO), DF(_QW), RESET
),
[_GA] = KEYMAP( /* Gaming */
_______, _______, _______, _______, _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______,
_______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______,
KC_Z, _______, _______, _______, _______, KC_BTN3, _______, KC_MS_D, _______, _______,
_______, TG(_GA), _______, KC_LSFT, KC_SPC, KC_BSPC, KC_BTN2, KC_BTN1, _______, _______, _______, _______
)};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View File

@ -0,0 +1,57 @@
# replicaJunction - Atreus Layout #
This layout is designed to make the absolute most out of the Atreus 40% keyboard.
I was enchanted with the idea of the Atreus keyboard after using my Ergodox for several months. I wanted something of a similar form factor that was easily portable, so I could bring and transport a keyboard to my workplace without much hassle. After building the Atreus keyboard, though, I realized very quickly that the 40% form factor requires a lot more creativity than a full-size keyboard (even one as strangely-shaped as the Ergodox).
The default Atreus keyboard layout provides all the necessary keys in order to function with the keyboard, but as a programmer, I needed quicker access to just about everything. I noticed that the default layer didn't include any dual-role keys, and so I started on my journey to build my perfect layout for the Atreus.
I won't claim that this layout is perfect for everyone. It does make several significant changes from the "normal" Atreus layout. In my own use, though, I've found this keyboard turbocharges my Atreus, and gives it the power of a full-size keyboard without the size.
## Base Layer ##
![Atreus base layout](atreus-replica-base-colemakdh.png)
The letters on this layout are arranged in the [Colemak Mod-DH layout](https://colemakmods.github.io/mod-dh/).
Note that there are four dual-purpose keys: Shift (Backspace), Ctrl (Delete), Alt (Enter), and Space (Number layer). In QMK, these dual-role keys can be made to hold their primary key by double-tapping the key and holding on the second tap. For example, if I wanted to insert a long string of Spaces, I would tap the Space key, then tap it again and hold. A single press and hold would trigger the secondary function of the key instead.
The secondary Alt on the left bottom row exists to provide a single-hand Alt+Tab shortcut, which would take two rows otherwise.
## Extend Layer ##
![Atreus extend layer](atreus-replica-extend.png)
This layout is designed primarily for keyboard navigation. Arrow keys are easily accessible under the right hand (a welcome change from the original Atreus layout, which places them under the left hand), along with Home/End and PgUp/PgDn.
Modifiers are also placed under the home row of the left hand. One of the single keyboard actions I use most is Shift+Ctrl+Left/Right to select a whole word; this layer makes those keypresses simple by adding the Ctrl key in an easy-to-reach location.
For the common Ctrl shortcuts, I also added some hotkeys to this layer over the letter keys they are associated with. This gives the Extend key some extra utility by letting it "feel" like a Ctrl key in some cases.
The Space key exists to prevent going from this layer directly into the Number layer. Similarly, the Shift key on the left pinky helps make sure that the normal letter (Z) doesn't fire.
## Number and Symbol Layer ##
![Atreus number and symbol layer](atreus-replica-num.png)
This layer provides the only way of accessing number keys on this keyboard, since it's too small for its own number row. Note that even though they are laid out in the number pad fashion, they send the "regular" number keystrokes. Games and programs that specifically use NumPad keys are not supported in this layout at the moment.
This layer also provides plenty of symbol shortcuts. Most of these can be accessed through other means (like Shift+8 for the asterisk), but having shortcut keys to them makes for one less keypress, which adds up quickly when using these symbols on a regular basis. I've been through many revisions of this concept on my Ergodox as well as the Atreus, and I've finally arrived at this layout as the one that provides the symbols I need most frequently in places I can think to expect them. The Ordinary layout from the Ergodox-EZ keyboard in this repository was a large influence in this design.
## Function Layer ##
![Atreus function layer](atreus-replica-function.png)
Function keys (F1-F12) are on this layer, as well as some more generic "functions" such as media keys. I've also set up a mirror image of the arrows from the Extend layer in case I need to use these with my left hand, but I don't do this very often.
The reset key is on this layer, as well as a toggle from Colemak to QWERTY and back. The QWERTY layer is not currently documented, but it is functionally identical to the base layer except for letter positions.
## Gaming Layer ##
![Atreus gaming layer](atreus-replica-game.png)
This is a small layer developed to allow some simple gameplay without a mouse. This layer is a toggle (from the Number layer), so it is designed to stay on while in use.
The keys on the left hand bring Space into the left thumb's reach, as well as overriding the dual-role Shift with its standard function (Z in both QWERTY and in Colemak). This allows easy Shift presses without blocking the Z key, commonly used in games.
I would probably not consider this a hard-core gaming keyboard, and this layout does have the huge problem of blocking access to the number keys, but for more casual games, it plays quite well. I've used it quite a bit on Minecraft, for example, and I'm quite pleased with it.

View File

@ -0,0 +1,89 @@
// This is the personal keymap of Ian Sterling (@xyverz). It is based on the keymap by
// Chris Gerber (@gerbercj), with the addition of persistent layers like the Planck and
// Preonic keyboards by Jack Humbert.
#include "atreus.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 _DV 0
#define _QW 1
#define _CM 2
#define _L1 3
#define _L2 4
// Macro name shortcuts
#define DVORAK M(_DV)
#define QWERTY M(_QW)
#define COLEMAK M(_CM)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* Dvorak */
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL}
},
[_QW] = { /* Qwerty */
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT}
},
[_CM] = { /* Colemak */
{KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
{KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O },
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT}
},
[_L1] = { /* LAYER 1 */
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 },
{KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL },
{KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS},
{KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT }
},
[_L2] = { /* LAYER 2 */
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS},
{KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 },
{KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET}
}
};
const uint16_t PROGMEM fn_actions[] = {
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};

View File

@ -174,13 +174,14 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder
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`.
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` 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:
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make KEYMAP=[default|jack|<name>]
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View File

@ -0,0 +1,82 @@
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
USB ?= /dev/cu.usbmodem1411
upload: build
$(ATREUS_UPLOAD_COMMAND)

View File

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

View File

@ -0,0 +1 @@
#include "atreus62.h"

View File

@ -0,0 +1,26 @@
#ifndef ATREUS62_H
#define ATREUS62_H
#include "quantum.h"
void promicro_bootloader_jmp(bool program);
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \
) \
{ \
{ k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \
{ k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \
}
#endif

View File

@ -0,0 +1,83 @@
/*
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 0x6062
#define DEVICE_VER 0x0001
#define MANUFACTURER Profet
#define PRODUCT Atreus62
#define DESCRIPTION q.m.k. keyboard firmware for Atreus62
/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 5
#define MATRIX_COLS 13
// wiring of each half
#define MATRIX_ROW_PINS { D2, D3, D1, D0, D4 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, C6 }
#define CATERINA_BOOTLOADER
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* 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

View File

@ -0,0 +1,71 @@
// this is the style you want to emulate.
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
#include "atreus62.h"
// 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 _DEFAULT 0
#define _NAV 1
#define _RESET 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DEFAULT] = { /* qwerty */
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS },
{ KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC },
{ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LBRC },
{ KC_LCTL, KC_LGUI, KC_LALT, KC_GRV, MO(_NAV),KC_BSPC, KC_ENT, KC_SPC, KC_EQL, KC_MINS, KC_QUOT, KC_ENT, KC_RGUI }
},
[_NAV] = {
{ TO(_DEFAULT), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS },
{ TO(_RESET), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
},
[_RESET] = {
{ TO(_DEFAULT), KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , RESET }
}
/*
[_TRNS] = {
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS }
},
*/
};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch (id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
}
else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View File

@ -0,0 +1,362 @@
/*
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2007 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
*/
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <avr/pgmspace.h>
// Workaround for wrong definitions in "iom32u4.h".
// This should be fixed in the AVR toolchain.
#undef UHCON
#undef UHINT
#undef UHIEN
#undef UHADDR
#undef UHFNUM
#undef UHFNUML
#undef UHFNUMH
#undef UHFLEN
#undef UPINRQX
#undef UPINTX
#undef UPNUM
#undef UPRST
#undef UPCONX
#undef UPCFG0X
#undef UPCFG1X
#undef UPSTAX
#undef UPCFG2X
#undef UPIENX
#undef UPDATX
#undef TCCR2A
#undef WGM20
#undef WGM21
#undef COM2B0
#undef COM2B1
#undef COM2A0
#undef COM2A1
#undef TCCR2B
#undef CS20
#undef CS21
#undef CS22
#undef WGM22
#undef FOC2B
#undef FOC2A
#undef TCNT2
#undef TCNT2_0
#undef TCNT2_1
#undef TCNT2_2
#undef TCNT2_3
#undef TCNT2_4
#undef TCNT2_5
#undef TCNT2_6
#undef TCNT2_7
#undef OCR2A
#undef OCR2_0
#undef OCR2_1
#undef OCR2_2
#undef OCR2_3
#undef OCR2_4
#undef OCR2_5
#undef OCR2_6
#undef OCR2_7
#undef OCR2B
#undef OCR2_0
#undef OCR2_1
#undef OCR2_2
#undef OCR2_3
#undef OCR2_4
#undef OCR2_5
#undef OCR2_6
#undef OCR2_7
#define NUM_DIGITAL_PINS 30
#define NUM_ANALOG_INPUTS 12
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
#define TXLED0 PORTD |= (1<<5)
#define TXLED1 PORTD &= ~(1<<5)
#define RXLED0 PORTB |= (1<<0)
#define RXLED1 PORTB &= ~(1<<0)
static const uint8_t SDA = 2;
static const uint8_t SCL = 3;
#define LED_BUILTIN 13
// Map SPI port to 'new' pins D14..D17
static const uint8_t SS = 17;
static const uint8_t MOSI = 16;
static const uint8_t MISO = 14;
static const uint8_t SCK = 15;
// Mapping of analog pins as digital I/O
// A6-A11 share with digital pins
static const uint8_t ADC0 = 18;
static const uint8_t ADC1 = 19;
static const uint8_t ADC2 = 20;
static const uint8_t ADC3 = 21;
static const uint8_t ADC4 = 22;
static const uint8_t ADC5 = 23;
static const uint8_t ADC6 = 24; // D4
static const uint8_t ADC7 = 25; // D6
static const uint8_t ADC8 = 26; // D8
static const uint8_t ADC9 = 27; // D9
static const uint8_t ADC10 = 28; // D10
static const uint8_t ADC11 = 29; // D12
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
#define digitalPinToPCICRbit(p) 0
#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
#ifdef ARDUINO_MAIN
// On the Arduino board, digital pins are also used
// for the analog output (software PWM). Analog input
// pins are a separate set.
// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
//
// D0 PD2 RXD1/INT2
// D1 PD3 TXD1/INT3
// D2 PD1 SDA SDA/INT1
// D3# PD0 PWM8/SCL OC0B/SCL/INT0
// D4 A6 PD4 ADC8
// D5# PC6 ??? OC3A/#OC4A
// D6# A7 PD7 FastPWM #OC4D/ADC10
// D7 PE6 INT6/AIN0
//
// D8 A8 PB4 ADC11/PCINT4
// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
// D12 A11 PD6 T1/#OC4D/ADC9
// D13# PC7 PWM10 CLK0/OC4A
//
// A0 D18 PF7 ADC7
// A1 D19 PF6 ADC6
// A2 D20 PF5 ADC5
// A3 D21 PF4 ADC4
// A4 D22 PF1 ADC1
// A5 D23 PF0 ADC0
//
// New pins D14..D17 to map SPI port to digital pins
//
// MISO D14 PB3 MISO,PCINT3
// SCK D15 PB1 SCK,PCINT1
// MOSI D16 PB2 MOSI,PCINT2
// SS D17 PB0 RXLED,SS/PCINT0
//
// Connected LEDs on board for TX and RX
// TXLED D24 PD5 XCK1
// RXLED D17 PB0
// HWB PE2 HWB
// these arrays map port names (e.g. port B) to the
// appropriate addresses for various functions (e.g. reading
// and writing)
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
(uint16_t) &DDRE,
(uint16_t) &DDRF,
};
const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
(uint16_t) &PORTE,
(uint16_t) &PORTF,
};
const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
(uint16_t) &PINE,
(uint16_t) &PINF,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, // D0 - PD2
PD, // D1 - PD3
PD, // D2 - PD1
PD, // D3 - PD0
PD, // D4 - PD4
PC, // D5 - PC6
PD, // D6 - PD7
PE, // D7 - PE6
PB, // D8 - PB4
PB, // D9 - PB5
PB, // D10 - PB6
PB, // D11 - PB7
PD, // D12 - PD6
PC, // D13 - PC7
PB, // D14 - MISO - PB3
PB, // D15 - SCK - PB1
PB, // D16 - MOSI - PB2
PB, // D17 - SS - PB0
PF, // D18 - A0 - PF7
PF, // D19 - A1 - PF6
PF, // D20 - A2 - PF5
PF, // D21 - A3 - PF4
PF, // D22 - A4 - PF1
PF, // D23 - A5 - PF0
PD, // D24 - PD5
PD, // D25 / D6 - A7 - PD7
PB, // D26 / D8 - A8 - PB4
PB, // D27 / D9 - A9 - PB5
PB, // D28 / D10 - A10 - PB6
PD, // D29 / D12 - A11 - PD6
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
_BV(2), // D0 - PD2
_BV(3), // D1 - PD3
_BV(1), // D2 - PD1
_BV(0), // D3 - PD0
_BV(4), // D4 - PD4
_BV(6), // D5 - PC6
_BV(7), // D6 - PD7
_BV(6), // D7 - PE6
_BV(4), // D8 - PB4
_BV(5), // D9 - PB5
_BV(6), // D10 - PB6
_BV(7), // D11 - PB7
_BV(6), // D12 - PD6
_BV(7), // D13 - PC7
_BV(3), // D14 - MISO - PB3
_BV(1), // D15 - SCK - PB1
_BV(2), // D16 - MOSI - PB2
_BV(0), // D17 - SS - PB0
_BV(7), // D18 - A0 - PF7
_BV(6), // D19 - A1 - PF6
_BV(5), // D20 - A2 - PF5
_BV(4), // D21 - A3 - PF4
_BV(1), // D22 - A4 - PF1
_BV(0), // D23 - A5 - PF0
_BV(5), // D24 - PD5
_BV(7), // D25 / D6 - A7 - PD7
_BV(4), // D26 / D8 - A8 - PB4
_BV(5), // D27 / D9 - A9 - PB5
_BV(6), // D28 / D10 - A10 - PB6
_BV(6), // D29 / D12 - A11 - PD6
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER0B, /* 3 */
NOT_ON_TIMER,
TIMER3A, /* 5 */
TIMER4D, /* 6 */
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER1A, /* 9 */
TIMER1B, /* 10 */
TIMER0A, /* 11 */
NOT_ON_TIMER,
TIMER4A, /* 13 */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
};
const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
7, // A0 PF7 ADC7
6, // A1 PF6 ADC6
5, // A2 PF5 ADC5
4, // A3 PF4 ADC4
1, // A4 PF1 ADC1
0, // A5 PF0 ADC0
8, // A6 D4 PD4 ADC8
10, // A7 D6 PD7 ADC10
11, // A8 D8 PB4 ADC11
12, // A9 D9 PB5 ADC12
13, // A10 D10 PB6 ADC13
9 // A11 D12 PD6 ADC9
};
#endif /* ARDUINO_MAIN */
// These serial port names are intended to allow libraries and architecture-neutral
// sketches to automatically default to the correct port name for a particular type
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
//
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
//
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
//
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
//
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
//
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
// pins are NOT connected to anything by default.
#define SERIAL_PORT_MONITOR Serial
#define SERIAL_PORT_USBVIRTUAL Serial
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1
#endif /* Pins_Arduino_h */

View File

@ -0,0 +1,10 @@
atreus62 keyboard firmware
======================
This firmware is for the atreus62 keyboard.
This version utilizes a Pro Micro for its controller and has a 62 key layout.
https://github.com/profet23/atreus62
TODO: More information

View File

@ -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
# 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 ?= yes # 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
UNICODE_ENABLE ?= yes # Unicode
#BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend

View File

@ -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

View File

@ -12,13 +12,14 @@ Download or clone the whole firmware and navigate to the keyboards/Bantam44 fold
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`.
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` 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:
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make KEYMAP=[default|jack|<name>]
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

View File

@ -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

View File

@ -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

View File

@ -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

View 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
# 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
ifndef QUANTUM_DIR
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

View File

@ -29,9 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5

View File

@ -66,19 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
#ifdef RGBLIGHT_ENABLE
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI),
#else
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS),
#endif
};
enum function_id {

View File

@ -0,0 +1,5 @@
# skullY's Clueboard Layout
This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing.
The most notable change from the default layout is putting Ctrl on the Capslock key. I also swap Alt and Cmd because I mostly use a Mac day to day.

View File

@ -0,0 +1,97 @@
Clueboard keyboard firmware
======================
DIY/Assembled compact 66% keyboard by [Clueboard](http://clueboard.co).
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
## First Time Setup
Download or clone the whole firmware and navigate to the keyboards/clueboard directory. Once your dev env is setup, you'll be able to generate the default .hex:
```
$ make
```
You will see a lot of output and if everything worked correctly you will see something similar to this:
```
Size after:
text data bss dec hex filename
0 19992 0 19992 4e18 clueboard_rev2_default.hex
```
At this point you can press RESET on your Clueboard and flash your keyboard with this command:
```
$ make dfu
```
If you would like to use one of the alternative keymaps, or create your own, see below.
## Clueboard 1.0
If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `rev1` to your make command, like this:
```
$ make rev1
```
And when flashing your keyboard:
```
$ make rev1-dfu
```
If you are flashing an alternative layout to your rev1, include both `rev1` and `<keymap>` in your command, for example when flashing max:
```
$ make rev1-max-dfu
```
## Alternate Keymaps
There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `<keymap>` to your command:
```
$ make skully
```
And when flashing your keyboard, put `<keymap>` between "make" and "dfu":
```
$ make skully-dfu
```
### Notable Layouts
These layouts are notable for one reason or another. If you are looking for ideas or inspiration you should look at these first:
* [keymaps/default](keymaps/default) - The default Clueboard layout
* [keymaps/max](keymaps/max) - A maximised layout that makes use of every key and feature of the Clueboard 2.0 PCB.
* [keymaps/skully](keymaps/skully) - The layout that @skullydazed uses on his own Clueboards.
## Create Your Own Keymap
There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend:
* Copy `[keymaps/default](keymaps/default/)` to `keymaps/<your_layout>`.
* Compile the firmware (`$ make <your_layout>`)
* Flash the firmware (`$ make <your_layout>-dfu`)
* Make sure everything works like the default keyboard
* Modify `keymaps/<your_layout>/readme.md` to tell others about your layout.
* Modify `keymaps/<your_layout>/keymap.c` to reflect your desired layout.
* Compile your new custom firmware (`$ make <your_layout>`)
** If you have warnings you may flash without fixing them, but something may not work right.
** If you have any errors you must fix them before continuing.
* Flash the firmware (`$ make <your_layout>-dfu`)
## Share Your Keymap
Got your layout dialed in? Please share it with the world so we can benefit from your work! Simply submit a pull request with your layout and we'll include it in the official repository. Please use the following guidelines when putting together your pull request:
* Include a readme.md that states what your primary keyboard use is, how your layout differs from the default, and highlights anything you think makes your layout particularly great.
* If your layout requires certain features (EG, RGB underlight or backlighting) ensure you have a Makefile and config.h that reflects that
* If your layout requires special hardware to be added, please describe that in the readme.md
TODO: Write up or link quick how-to on creating and submitting a PR. (Pull requests accepted. :)

View File

@ -1,5 +1,3 @@
BACKLIGHT_ENABLE = no
ifndef QUANTUM_DIR
ifndef MAKEFILE_INCLUDED
include ../../../Makefile
endif

View File

@ -26,7 +26,7 @@
/* Underlight configuration
*/
#define RGB_DI_PIN B2
#define RGBLIGHT_TIMER
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 14 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17

View File

@ -0,0 +1,5 @@
BACKLIGHT_ENABLE = no
ifndef QUANTUM_DIR
include ../../../Makefile
endif

View File

@ -1,5 +1,3 @@
BACKLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
ifndef MAKEFILE_INCLUDED
include ../../../Makefile
endif

View File

@ -30,7 +30,7 @@
/* Underlight configuration
*/
#define RGB_DI_PIN D7
#define RGBLIGHT_TIMER
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 14 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17

View File

@ -0,0 +1,5 @@
BACKLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../Makefile
endif

View File

@ -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

View File

@ -1,63 +0,0 @@
#include "clueboard2.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
led_init_ports();
// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
};
void led_init_ports() {
// * Set our LED pins as output
DDRB |= (1<<4);
}
void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB |= (1<<4);
} else {
// Turn capslock off
PORTB &= ~(1<<4);
}
}
/* Clueboard 2.0 LED locations:
*
* Capslock: B4, pull high to turn on
* LCtrl: Shared with Capslock, DO NOT INSTALL LED'S IN BOTH
* Page Up: B7, pull high to turn on
* Escape: D6, pull high to turn on
* Arrows: D4, pull high to turn on
*/
void backlight_init_ports(void) {
print("init_backlight_pin()\n");
// Set our LED pins as output
DDRD |= (1<<6); // Esc
DDRB |= (1<<7); // Page Up
DDRD |= (1<<4); // Arrows
// Set our LED pins low
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
void backlight_set(uint8_t level) {
if ( level == 0 ) {
// Turn off light
PORTD |= (1<<6); // Esc
PORTB |= (1<<7); // Page Up
PORTD |= (1<<4); // Arrows
} else {
// Turn on light
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
}

View File

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

View File

@ -0,0 +1,98 @@
#include "cluecard.h"
#define BL_RED OCR1B
#define BL_GREEN OCR1A
#define BL_BLUE OCR1C
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
void backlight_init_ports(void)
{
// Set B5, B6, and B7 as output
DDRB |= (1<<7)|(1<<6)|(1<<5);
// Setup PWM
ICR1 = 0xFFFF;
TCCR1A = 0b10101010;
TCCR1B = 0b00011001;
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
}
void backlight_set(uint8_t level)
{
// Set the RGB color
switch (level)
{
case 0:
// Off
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
break;
case 1:
// Red
BL_RED = 0x0000;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
break;
case 2:
// Green
BL_RED = 0xFFFF;
BL_GREEN = 0x0000;
BL_BLUE = 0xFFFF;
break;
case 3:
// Blue
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0x0000;
break;
case 4:
// Magenta
BL_RED = 0x4000;
BL_GREEN = 0x4000;
BL_BLUE = 0x4000;
break;
case 5:
// Purple
BL_RED = 0x0000;
BL_GREEN = 0xFFFF;
BL_BLUE = 0x0000;
break;
case 6:
// Yellow
BL_RED = 0x0000;
BL_GREEN = 0x0000;
BL_BLUE = 0xFFFF;
break;
default:
xprintf("Unknown level: %d\n", level);
}
}

View File

@ -0,0 +1,22 @@
#ifndef CLUECARD_H
#define CLUECARD_H
#include "quantum.h"
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, \
k10, k12, \
k20, k21, k22, \
k11, \
k30, k31, k32 \
) { \
{ k00, k01, k02, }, \
{ k10, k11, k12, }, \
{ k20, k21, k22, }, \
{ k30, k31, k32, } \
}
#endif

View File

@ -0,0 +1,167 @@
/*
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 0xC1ED
#define PRODUCT_ID 0x2330
#define DEVICE_VER 0x0001
#define MANUFACTURER Clueboard
#define PRODUCT ATMEGA32U4 Firmware Dev Kit
#define DESCRIPTION A small board to help you hack on QMK.
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 3
/*
* 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 { F0, F5, F4, B4 }
#define MATRIX_COL_PINS { F1, F7, F6 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 20
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 6
/* 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
/* Underlight configuration
*/
#define RGB_DI_PIN E6
//#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 4 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* 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

View File

@ -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 = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
CONSOLE_ENABLE = yes # 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 = yes # 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 = yes # Enable WS2812 RGB underlight.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
#endif

View File

@ -0,0 +1,63 @@
#include "cluecard.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
RGB_TOG, RGB_SAI, RGB_VAI, \
RGB_HUD, RGB_HUI, \
RGB_MOD, RGB_SAD, RGB_VAD, \
BL_STEP, \
F(0), F(1), F(2) \
)
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_plover[][2] = SONG(PLOVER_SOUND);
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0),
[1] = ACTION_FUNCTION(1),
[2] = ACTION_FUNCTION(2)
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
if (record->event.pressed) {
switch (id) {
case 0:
PLAY_NOTE_ARRAY(tone_startup, false, 0);
break;
case 1:
PLAY_NOTE_ARRAY(music_scale, false, 0);
break;
case 2:
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
break;
}
}
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -0,0 +1,5 @@
# The default keymap for cluecard
Note that this keymap has audio enabled, so the RGB mode button does not go through the different effects.
So the LEDs will still show a static light, that is configurable with the hue, staturation and brightness
buttons. You can of course also turn them on and off with the on/off button.

Some files were not shown because too many files have changed in this diff Show More