Skip to content

Commit

Permalink
Merge pull request #13 from jackhumbert/master
Browse files Browse the repository at this point in the history
Merged from qmk
  • Loading branch information
Dbroqua authored Dec 9, 2016
2 parents a849bdc + 985a091 commit 13c4080
Show file tree
Hide file tree
Showing 191 changed files with 14,432 additions and 2,405 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ ENV subproject=ez
ENV keymap=default

VOLUME /qmk
WORKDIR /qmk
CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap}
WORKDIR /qmk
57 changes: 39 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ERROR_FILE := $(BUILD_DIR)/error_occured

MAKEFILE_INCLUDED=yes

# Helper function to process the newt element of a space separated path
# 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
Expand All @@ -47,16 +47,16 @@ define NEXT_PATH_ELEMENT
$$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
endef

# We change the / to spaces so that we more easily can work with the elements
# 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
# 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.
# 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))
Expand Down Expand Up @@ -111,7 +111,7 @@ endif
.DEFAULT_GOAL := all
ifneq ($(KEYMAP),)
ifeq ($(SUBPROJECT),)
# Inside a keymap folder, just build the keymap, with the
# Inside a keymap folder, just build the keymap, with the
# default subproject
.DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
else
Expand Down Expand Up @@ -163,18 +163,18 @@ 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
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
# 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
# Stop the recursion when the list is empty
ifneq ($1,)
RULE_BEFORE := $$(RULE)
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
Expand Down Expand Up @@ -270,7 +270,7 @@ define PARSE_KEYBOARD
$$(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
else
$$(eval $$(call PARSE_SUBPROJECT,))
endif
endef
Expand All @@ -285,7 +285,7 @@ endef
# 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
# 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),)
Expand All @@ -304,7 +304,7 @@ define PARSE_SUBPROJECT
endif
endif
# The special allsp is handled later
ifneq ($$(CURRENT_SP),allsp)
ifneq ($$(CURRENT_SP),allsp)
# get a list of all keymaps
KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
ifneq ($$(CURRENT_SP),)
Expand Down Expand Up @@ -343,7 +343,7 @@ define PARSE_SUBPROJECT
endif
endef

# If we want to parse all subprojects, but the keyboard doesn't have any,
# If we want to parse all subprojects, but the keyboard doesn't have any,
# then use defaultsp instead
define PARSE_ALL_SUBPROJECTS
ifeq ($$(SUBPROJECTS),)
Expand Down Expand Up @@ -448,7 +448,7 @@ 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
# 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
Expand Down Expand Up @@ -481,11 +481,12 @@ 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
$(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
Expand All @@ -505,8 +506,24 @@ $(SUBPROJECTS): %: %-allkm
# 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))
$(foreach TEST,$(TESTS),$(RUN_TEST))
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
else
%:
# 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

# All should compile everything
.PHONY: all
Expand All @@ -526,7 +543,11 @@ test: test-all
test-clean: test-all-clean

# Generate the version.h file
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
ifndef SKIP_GIT
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
else
GIT_VERSION := NA
endif
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
Expand Down
15 changes: 15 additions & 0 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ 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
Expand Down Expand Up @@ -174,6 +182,12 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
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)
Expand All @@ -199,6 +213,7 @@ endif
VPATH += $(KEYBOARD_PATH)
VPATH += $(COMMON_VPATH)

include $(TMK_PATH)/protocol.mk

include $(TMK_PATH)/common.mk
SRC += $(TMK_COMMON_SRC)
Expand Down
1 change: 1 addition & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ 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)
2 changes: 1 addition & 1 deletion keyboards/amj60/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#define RGB_DI_PIN E2
#define RGBLIGHT_TIMER
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 8 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
Expand Down
3 changes: 3 additions & 0 deletions keyboards/atreus62/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif
1 change: 1 addition & 0 deletions keyboards/atreus62/atreus62.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "atreus62.h"
26 changes: 26 additions & 0 deletions keyboards/atreus62/atreus62.h
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions keyboards/atreus62/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
Copyright 2012 Jun Wako <[email protected]>
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
Loading

0 comments on commit 13c4080

Please sign in to comment.