Skip to content

Commit

Permalink
Merge pull request #21 from qmk/master
Browse files Browse the repository at this point in the history
Merge from QMK
  • Loading branch information
Dbroqua authored Apr 29, 2017
2 parents 215dd12 + 26bbfd7 commit 584b804
Show file tree
Hide file tree
Showing 92 changed files with 2,831 additions and 234 deletions.
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ override SILENT := false

ON_ERROR := error_occurred=1

BREAK_ON_ERRORS = no

STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
ROOT_DIR := $(dir $(ROOT_MAKEFILE))
Expand Down Expand Up @@ -462,20 +464,25 @@ endef

include $(ROOT_DIR)/message.mk

ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
HANDLE_ERROR = exit 1
else
HANDLE_ERROR = echo $$error_occurred > $(ERROR_FILE)
endif

# 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_occurred=0;\
$(COMMAND_$(SILENT_MODE)_$(COMMAND))\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi;
if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;


endef
define RUN_TEST
+error_occurred=0;\
$($(TEST)_COMMAND)\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi;

if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef

# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
Expand Down Expand Up @@ -527,14 +534,22 @@ test: test-all
.PHONY: test-clean
test-clean: test-all-clean

ifdef SKIP_VERSION
SKIP_GIT := yes
endif

# 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
GIT_VERSION := NA
endif
ifndef SKIP_VERSION
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)
else
BUILD_DATE := NA
endif

include $(ROOT_DIR)/testlist.mk
10 changes: 7 additions & 3 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,26 @@ endif

ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
endif

ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
endif

ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
endif

ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif

ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/light_ws2812.c
Expand Down
5 changes: 5 additions & 0 deletions keyboards/M10A/M10A.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "M10A.h"

void matrix_init_kb(void) {
matrix_init_user();
}
19 changes: 19 additions & 0 deletions keyboards/M10A/M10A.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef M10A_H
#define M10A_H

#include "quantum.h"

#define M10A( \
k00, k01, k02, \
k10, k11, k12, \
k20, k21, k22, \
k30, k31, k32 \
) \
{ \
{ k00, k01, k02 }, \
{ k10, k11, k12 }, \
{ k20, k21, k22 }, \
{ k30, k31, k32 } \
}

#endif
3 changes: 3 additions & 0 deletions keyboards/M10A/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif
82 changes: 82 additions & 0 deletions keyboards/M10A/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
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 0x0007
#define DEVICE_VER 0x0001
#define MANUFACTURER Machine Industries
#define PRODUCT M10-A
#define DESCRIPTION RAMA x Machine Industries M10-A

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 3

/* Planck PCB default pin-out */
#define MATRIX_ROW_PINS { B6, F7, F6, D6 }
#define MATRIX_COL_PINS { F5, F1, F0 }
#define UNUSED_PINS

#define BACKLIGHT_PIN B7

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
#define BACKLIGHT_LEVELS 6

/* 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
3 changes: 3 additions & 0 deletions keyboards/M10A/keymaps/default/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ifndef QUANTUM_DIR
include ../../../../Makefile
endif
49 changes: 49 additions & 0 deletions keyboards/M10A/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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 "M10A.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.

enum layers {
_LAYER0,
_LAYER1,
_LAYER2,
_LAYER3,
_LAYER4,
_LAYER5,
_LAYER6,
_LAYER7,
_LAYER8,
_LAYER9
};

// // Fillers to make layering more clear
// #define _______ KC_TRNS
// #define XXXXXXX KC_NO

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER1] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER2] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER3] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER4] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER5] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER6] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER7] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER8] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
[_LAYER9] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}
};

void matrix_init_user(void) {
#ifdef BACKLIGHT_ENABLE
backlight_level(0);
#endif
}
68 changes: 68 additions & 0 deletions keyboards/M10A/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# MCU name
#MCU = at90usb1287
MCU = atmega32u4

# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000

#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)

# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=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 ?= no # 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 ?= no # Audio output on port C6
UNICODE_ENABLE ?= yes # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight.
API_SYSEX_ENABLE = yes

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
17 changes: 16 additions & 1 deletion keyboards/amjpad/amjpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,22 @@
{k40, k41, k42, k43}, \
{k50, XXX, k52, XXX} \
}

#define MAXKEYMAP( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k51, k52, k53\
) \
{ \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k30, k31, k32, k33}, \
{k40, k41, k42, k43}, \
{k50, k51, k52, k53} \
}
void matrix_init_user(void);
void matrix_scan_user(void);

Expand Down
Loading

0 comments on commit 584b804

Please sign in to comment.