summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--keyboard/alps64/Makefile9
-rw-r--r--keyboard/alps64/alps64.c (renamed from keyboard/alps64/keymap_common.c)31
-rw-r--r--keyboard/alps64/alps64.h (renamed from keyboard/alps64/keymap_common.h)21
-rw-r--r--keyboard/alps64/config.h5
-rw-r--r--keyboard/alps64/keymaps/default.c4
-rw-r--r--keyboard/alps64/keymaps/hasu.c4
-rw-r--r--keyboard/alps64/matrix.c5
-rw-r--r--keyboard/gh60/Makefile10
-rw-r--r--keyboard/gh60/keymap_common.c30
-rw-r--r--keyboard/hhkb/Makefile2
-rw-r--r--keyboard/hhkb/matrix.c8
-rw-r--r--keyboard/jd45/Makefile2
-rw-r--r--keyboard/kc60_v2/Makefile158
-rw-r--r--keyboard/kc60_v2/README.md24
-rw-r--r--keyboard/kc60_v2/config.h161
-rw-r--r--keyboard/kc60_v2/kc60.c111
-rw-r--r--keyboard/kc60_v2/kc60.h36
-rw-r--r--keyboard/kc60_v2/keymaps/default.c24
-rw-r--r--keyboard/planck/.gitignore1
-rw-r--r--quantum/keymap_common.h10
-rw-r--r--quantum/matrix.c6
-rw-r--r--quantum/quantum.c13
-rw-r--r--quantum/quantum.h4
-rw-r--r--quantum/quantum.mk4
-rw-r--r--quantum/template/Makefile2
-rw-r--r--tmk_core/rules.mk14
27 files changed, 606 insertions, 105 deletions
diff --git a/README.md b/README.md
index 646fa6f2b1..2c82575285 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,17 @@ This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If y
The OLKB product firmwares are maintained by Jack, the Ergodox EZ by Erez, and the Clueboard by [Zach White](https://github.com/skullydazed).
-## Important background info: TMK documentation
+## Documentation roadmap
-The documentation below explains QMK customizations and elaborates on some of the more useful features of TMK. To understand the base firmware, and especially what *layers* are and how they work, please see [TMK_README.md](/TMK_README.md).
+This is not a tiny project. While this is the main Readme, there are many other files you might want to consult. Here are some points of interest:
+
+* The Readme for your own keyboard: This is found under `keyboards/<your keyboards's name>/`. So for the ErgoDox EZ, it's [here](keyboard/ergodox_ez/); for the Atomic, it's [here](keyboard/atomic/) and so on.
+* The [build guide](BUILD_GUIDE.md), also mentioned in the next section. This is how you put your development environment together so you can compile the firmware.
+* The list of possible keycodes you can use in your keymap is actually spread out in a few different places:
+ * [tmk_core/common/keycode.h](tmk_core/common/keycode.h) - the base TMK keycodes. This is the actual source file.
+ * [tmk_core/doc/keycode.txt](tmk_core/doc/keycode.txt) - an explanation of those same keycodes.
+ * [quantum/keymap_common.h](quantum/keymap_common.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap_common.h` is where they're actually defined.
+* The [TMK documentation](tmk_core/doc). QMK is based on TMK, and this explains how it works internally.
## Getting started
diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile
index 7634c4280e..bd6ecb6b91 100644
--- a/keyboard/alps64/Makefile
+++ b/keyboard/alps64/Makefile
@@ -42,14 +42,14 @@
TARGET = alps64
# Directory common source filess exist
+TOP_DIR = ../..
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
-SRC = keymap_common.c \
- matrix.c \
+SRC = alps64.c \
led.c
ifdef KEYMAP
@@ -127,8 +127,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
# Search Path
VPATH += $(TARGET_DIR)
+VPATH += $(TOP_DIR)
VPATH += $(TMK_DIR)
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk
+include $(TOP_DIR)/quantum/quantum.mk
diff --git a/keyboard/alps64/keymap_common.c b/keyboard/alps64/alps64.c
index fdb1769e1c..dde10c11e3 100644
--- a/keyboard/alps64/keymap_common.c
+++ b/keyboard/alps64/alps64.c
@@ -14,17 +14,30 @@ 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/>.
*/
-#include "keymap_common.h"
+#include "quantum.h"
+#define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0)
+#define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0)
+#define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0)
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
- return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
+__attribute__ ((weak))
+void matrix_init_user(void) {
+
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+
+}
+
+void matrix_init_kb(void) {
+ LED_ON();
+ _delay_ms(500);
+ LED_OFF();
+
+ matrix_init_user();
}
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
- return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
+void matrix_scan_kb(void) {
+ matrix_scan_user();
}
diff --git a/keyboard/alps64/keymap_common.h b/keyboard/alps64/alps64.h
index 957db57922..d0777201e0 100644
--- a/keyboard/alps64/keymap_common.h
+++ b/keyboard/alps64/alps64.h
@@ -14,25 +14,10 @@ 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 KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "host.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
+#ifndef ALPS64_H
+#define ALPS64_H
+#include "quantum.h"
/* Alps64 keymap definition macro */
#define KEYMAP( \
diff --git a/keyboard/alps64/config.h b/keyboard/alps64/config.h
index 824d3e8302..858a82ecdd 100644
--- a/keyboard/alps64/config.h
+++ b/keyboard/alps64/config.h
@@ -18,6 +18,7 @@ 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
@@ -31,6 +32,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 8
#define MATRIX_COLS 8
+#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
+#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5, D6, C2 }
+#define UNUSED_PINS
+
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
diff --git a/keyboard/alps64/keymaps/default.c b/keyboard/alps64/keymaps/default.c
index a54899196a..2c45dc7f34 100644
--- a/keyboard/alps64/keymaps/default.c
+++ b/keyboard/alps64/keymaps/default.c
@@ -1,6 +1,6 @@
-#include "keymap_common.h"
+#include "alps64.h"
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \
diff --git a/keyboard/alps64/keymaps/hasu.c b/keyboard/alps64/keymaps/hasu.c
index d297d72fea..e93dd0d410 100644
--- a/keyboard/alps64/keymaps/hasu.c
+++ b/keyboard/alps64/keymaps/hasu.c
@@ -1,9 +1,9 @@
-#include "keymap_common.h"
+#include "alps64.h"
/*
* Hasu
*/
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default Layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |
diff --git a/keyboard/alps64/matrix.c b/keyboard/alps64/matrix.c
index 5638d7f69d..805999d4a1 100644
--- a/keyboard/alps64/matrix.c
+++ b/keyboard/alps64/matrix.c
@@ -55,10 +55,6 @@ uint8_t matrix_cols(void)
return MATRIX_COLS;
}
-#define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0)
-#define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0)
-#define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0)
-
void matrix_init(void)
{
// initialize row and col
@@ -160,6 +156,7 @@ static void unselect_rows(void)
PORTC &= ~0b00000100;
}
+
static void select_row(uint8_t row)
{
// Output low(DDR:1, PORT:0) to select
diff --git a/keyboard/gh60/Makefile b/keyboard/gh60/Makefile
index 4c8f9dc8ab..9429049fd9 100644
--- a/keyboard/gh60/Makefile
+++ b/keyboard/gh60/Makefile
@@ -42,14 +42,14 @@
TARGET = gh60_lufa
# Directory common source filess exist
+TOP_DIR = ../..
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
-SRC = keymap_common.c \
- matrix.c \
+SRC = matrix.c \
led.c
ifdef KEYMAP
@@ -119,6 +119,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
+CUSTOM_MATRIX = yes
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
@@ -128,8 +129,7 @@ NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
# Search Path
VPATH += $(TARGET_DIR)
+VPATH += $(TOP_DIR)
VPATH += $(TMK_DIR)
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk \ No newline at end of file
+include $(TOP_DIR)/quantum/quantum.mk
diff --git a/keyboard/gh60/keymap_common.c b/keyboard/gh60/keymap_common.c
deleted file mode 100644
index fdb1769e1c..0000000000
--- a/keyboard/gh60/keymap_common.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-Copyright 2012,2013 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/>.
-*/
-#include "keymap_common.h"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
- return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
- return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}
diff --git a/keyboard/hhkb/Makefile b/keyboard/hhkb/Makefile
index 21ba261a23..b6c3b869e4 100644
--- a/keyboard/hhkb/Makefile
+++ b/keyboard/hhkb/Makefile
@@ -56,7 +56,7 @@ SRC = hhkb_qmk.c \
ifdef KEYMAP
SRC := keymaps/keymaps/$(KEYMAP).c $(SRC)
else
- SRC := keymaps/keymaps/default.c $(SRC)
+ SRC := keymaps/default.c $(SRC)
endif
CONFIG_H = config.h
diff --git a/keyboard/hhkb/matrix.c b/keyboard/hhkb/matrix.c
index 14fae0b82c..2dfb2f5e1f 100644
--- a/keyboard/hhkb/matrix.c
+++ b/keyboard/hhkb/matrix.c
@@ -188,6 +188,14 @@ void matrix_print(void)
}
}
+uint8_t matrix_key_count(void) {
+ uint8_t count = 0;
+ for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
+ count += bitpop16(matrix_get_row(r));
+ }
+ return count;
+}
+
void matrix_power_up(void) {
KEY_POWER_ON();
}
diff --git a/keyboard/jd45/Makefile b/keyboard/jd45/Makefile
index f6a8d10c58..d270a6f8a7 100644
--- a/keyboard/jd45/Makefile
+++ b/keyboard/jd45/Makefile
@@ -56,7 +56,7 @@ SRC = jd45.c \
ifdef KEYMAP
SRC := keymaps/keymaps/(KEYMAP).c $(SRC)
else
- SRC := keymaps/keymaps/default.c $(SRC)
+ SRC := keymaps/default.c $(SRC)
endif
CONFIG_H = config.h
diff --git a/keyboard/kc60_v2/Makefile b/keyboard/kc60_v2/Makefile
new file mode 100644
index 0000000000..33ece31647
--- /dev/null
+++ b/keyboard/kc60_v2/Makefile
@@ -0,0 +1,158 @@
+#----------------------------------------------------------------------------
+# 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".
+#----------------------------------------------------------------------------
+
+# Target file name (without extension).
+TARGET = kc60
+
+
+# Directory common source filess exist
+TOP_DIR = ../..
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# # project specific files
+SRC = kc60.c
+
+ifdef KEYMAP
+ SRC := keymaps/$(KEYMAP).c $(SRC)
+else
+ SRC := keymaps/default.c $(SRC)
+endif
+
+CONFIG_H = config.h
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u4
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency in Hz. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+#
+# This will be an integer division of F_USB below, as it is sourced by
+# F_USB after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+# This will define a symbol, F_USB, in all source code files equal to the
+# input clock frequency (before any prescaling is performed) in Hz. This value may
+# differ from F_CPU if prescaling is used on the latter, and is required as the
+# raw input clock is fed directly to the PLL sections of the AVR for high speed
+# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+# at the end, this will be done automatically to create a 32-bit value in your
+# source code.
+#
+# If no clock division is performed on the input clock inside the AVR (via the
+# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+# Teensy halfKay 512
+# Teensy++ halfKay 1024
+# Atmel DFU loader 4096
+# LUFA bootloader 4096
+# USBaspLoader 2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
+CONSOLE_ENABLE = yes # Console for debug(+400)
+COMMAND_ENABLE = yes # Commands for debug and configuration
+KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
+MIDI_ENABLE = no # MIDI controls
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+
+
+ifdef KEYMAP
+
+ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
+ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
+ include keymaps/$(KEYMAP)/makefile.mk
+endif
+endif
+
+else
+
+ifneq ("$(wildcard keymaps/default/makefile.mk)","")
+ include keymaps/default/makefile.mk
+endif
+
+endif
+
+# Optimize size but this may cause error "relocation truncated to fit"
+#EXTRALDFLAGS = -Wl,--relax
+
+# Search Path
+VPATH += $(TARGET_DIR)
+VPATH += $(TOP_DIR)
+VPATH += $(TMK_DIR)
+
+include $(TOP_DIR)/quantum/quantum.mk
+
diff --git a/keyboard/kc60_v2/README.md b/keyboard/kc60_v2/README.md
new file mode 100644
index 0000000000..4be448d15c
--- /dev/null
+++ b/keyboard/kc60_v2/README.md
@@ -0,0 +1,24 @@
+kc60 keyboard firmware
+======================
+
+## 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 keyboard/kc60 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
+
+Depending on which keymap you would like to use, you will have to compile slightly differently.
+
+### Default
+To build with the default keymap, simply run `make`.
+
+### Other Keymaps
+Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files.
+
+To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
+```
+$ make KEYMAP=[default|jack|<name>]
+```
+Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboard/kc60_v2/config.h b/keyboard/kc60_v2/config.h
new file mode 100644
index 0000000000..16bc1cbb29
--- /dev/null
+++ b/keyboard/kc60_v2/config.h
@@ -0,0 +1,161 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x6060
+#define DEVICE_VER 0x0001
+#define MANUFACTURER You
+#define PRODUCT kc60v2
+#define DESCRIPTION A custom keyboard
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 14
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+*/
+
+// Possible pins for columns include: F1 F0 E6 D7 D6 D4 C7 C6 B7 B5 B4 B3 B1 B0
+// Pins for rows include: D0 D1 F6 F7 D5
+#define MATRIX_ROW_PINS { D0, D1, F6, F7, D5 }
+#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3 }
+#define UNUSED_PINS
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/*
+ * Force NKRO
+ *
+ * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
+ * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
+ * makefile for this to work.)
+ *
+ * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
+ * until the next keyboard reset.
+ *
+ * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
+ * fully operational during normal computer usage.
+ *
+ * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
+ * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
+ * bootmagic, NKRO mode will always be enabled until it is toggled again during a
+ * power-up.
+ *
+ */
+//#define FORCE_NKRO
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
+#define IS_COMMAND() ( \
+ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP1 H
+//#define MAGIC_KEY_HELP2 SLASH
+//#define MAGIC_KEY_DEBUG D
+//#define MAGIC_KEY_DEBUG_MATRIX X
+//#define MAGIC_KEY_DEBUG_KBD K
+//#define MAGIC_KEY_DEBUG_MOUSE M
+//#define MAGIC_KEY_VERSION V
+//#define MAGIC_KEY_STATUS S
+//#define MAGIC_KEY_CONSOLE C
+//#define MAGIC_KEY_LAYER0_ALT1 ESC
+//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
+//#define MAGIC_KEY_LAYER0 0
+//#define MAGIC_KEY_LAYER1 1
+//#define MAGIC_KEY_LAYER2 2
+//#define MAGIC_KEY_LAYER3 3
+//#define MAGIC_KEY_LAYER4 4
+//#define MAGIC_KEY_LAYER5 5
+//#define MAGIC_KEY_LAYER6 6
+//#define MAGIC_KEY_LAYER7 7
+//#define MAGIC_KEY_LAYER8 8
+//#define MAGIC_KEY_LAYER9 9
+//#define MAGIC_KEY_BOOTLOADER PAUSE
+//#define MAGIC_KEY_LOCK CAPS
+//#define MAGIC_KEY_EEPROM E
+//#define MAGIC_KEY_NKRO N
+//#define MAGIC_KEY_SLEEP_LED Z
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboard/kc60_v2/kc60.c b/keyboard/kc60_v2/kc60.c
new file mode 100644
index 0000000000..0a578b2b88
--- /dev/null
+++ b/keyboard/kc60_v2/kc60.c
@@ -0,0 +1,111 @@
+#include "kc60.h"
+
+__attribute__ ((weak))
+ void matrix_init_user(void) {
+ // leave this function blank - it can be defined in a keymap file
+ };
+
+__attribute__ ((weak))
+ void matrix_scan_user(void) {
+ // leave this function blank - it can be defined in a keymap file
+ }
+
+__attribute__ ((weak))
+ bool process_action_user(keyrecord_t *record) {
+ // leave this function blank - it can be defined in a keymap file
+ return true;
+ }
+
+__attribute__ ((weak))
+ void led_set_user(uint8_t usb_led) {
+ // leave this function blank - it can be defined in a keymap file
+ }
+
+void matrix_init_kb(void) {
+ // put your keyboard start-up code here
+ // runs once when the firmware starts up
+
+#ifdef BACKLIGHT_ENABLE
+ backlight_init_ports();
+#endif
+
+ matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+ // put your looping keyboard code here
+ // runs every cycle (a lot)
+
+ matrix_scan_user();
+}
+
+bool process_action_kb(keyrecord_t *record) {
+ // put your per-action keyboard code here
+ // runs for every action, just before processing by the firmware
+
+ return process_action_user(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);
+}
+
+#ifdef BACKLIGHT_ENABLE
+#define CHANNEL OCR1B
+
+void backlight_init_ports()
+{
+
+ // Setup PB6 as output and output low.
+ DDRB |= (1<<6);
+ PORTB &= ~(1<<6);
+
+ // Use full 16-bit resolution.
+ ICR1 = 0xFFFF;
+
+ // I could write a wall of text here to explain... but TL;DW
+ // Go read the ATmega32u4 datasheet.
+ // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
+
+ // Pin PB7 = OCR1C (Timer 1, Channel C)
+ // Compare Output Mode = Clear on compare match, Channel C = COM1B1=1 COM1C0=0
+ // (i.e. start high, go low when counter matches.)
+ // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
+ // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
+
+ TCCR1A = _BV(COM1B1) | _BV(WGM11); // = 0b00001010;
+ TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
+
+ backlight_init();
+}
+
+void backlight_set(uint8_t level)
+{
+ // Prevent backlight blink on lowest level
+ PORTB &= ~(_BV(PORTB6));
+
+ if ( level == 0 )
+ {
+ // Turn off PWM control on PB6, revert to output low.
+ TCCR1A &= ~(_BV(COM1B1));
+ CHANNEL = 0x0;
+ }
+ else if ( level == BACKLIGHT_LEVELS)
+ {
+ // Turn on PWM control of PB6
+ TCCR1A |= _BV(COM1B1);
+ // Set the brightness
+ CHANNEL = 0xFFFF;
+ }
+ else
+ {
+ // Turn on PWM control of PB6
+ TCCR1A |= _BV(COM1B1);
+ // Set the brightness
+ CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
+ }
+}
+
+#endif
diff --git a/keyboard/kc60_v2/kc60.h b/keyboard/kc60_v2/kc60.h
new file mode 100644
index 0000000000..d346a55028
--- /dev/null
+++ b/keyboard/kc60_v2/kc60.h
@@ -0,0 +1,36 @@
+#ifndef KC60_H
+#define KC60_H
+
+#include "matrix.h"
+#include "keymap_common.h"
+#ifdef BACKLIGHT_ENABLE
+#include "backlight.h"
+#endif
+#include <avr/io.h>
+#include <stddef.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 multi-dimensional array
+#define KEYMAP( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
+ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
+ K40, K41, K42, K45, 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, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \
+}
+
+void matrix_init_user(void);
+void matrix_scan_user(void);
+bool process_action_user(keyrecord_t *record);
+
+void led_set_user(uint8_t usb_led);
+void backlight_init_ports(void);
+
+#endif
diff --git a/keyboard/kc60_v2/keymaps/default.c b/keyboard/kc60_v2/keymaps/default.c
new file mode 100644
index 0000000000..6f8352c695
--- /dev/null
+++ b/keyboard/kc60_v2/keymaps/default.c
@@ -0,0 +1,24 @@
+// 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 "kc60.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = KEYMAP( /* Basic 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
+ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, \
+ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, 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
+ return MACRO_NONE;
+};
diff --git a/keyboard/planck/.gitignore b/keyboard/planck/.gitignore
new file mode 100644
index 0000000000..6e92f57d46
--- /dev/null
+++ b/keyboard/planck/.gitignore
@@ -0,0 +1 @@
+tags
diff --git a/quantum/keymap_common.h b/quantum/keymap_common.h
index db14e7d8ac..c72c0bc29d 100644
--- a/quantum/keymap_common.h
+++ b/quantum/keymap_common.h
@@ -88,10 +88,8 @@ extern const uint16_t fn_actions[];
#define KC_AT LSFT(KC_2) // @
-
#define KC_HASH LSFT(KC_3) // #
-
#define KC_DLR LSFT(KC_4) // $
#define KC_DOLLAR KC_DLR
@@ -113,15 +111,11 @@ extern const uint16_t fn_actions[];
#define KC_RPRN LSFT(KC_0) // )
#define KC_RIGHT_PAREN KC_RPRN
-
#define KC_UNDS LSFT(KC_MINS) // _
#define KC_UNDERSCORE KC_UNDS
#define KC_PLUS LSFT(KC_EQL) // +
-#define KC_DQUO LSFT(KC_QUOT) // "
-#define KC_DOUBLE_QUOTE KC_DQUO
-
#define KC_LCBR LSFT(KC_LBRC) // {
#define KC_LEFT_CURLY_BRACE KC_LCBR
@@ -141,16 +135,14 @@ extern const uint16_t fn_actions[];
#define KC_LT LSFT(KC_COMM) // <
-
#define KC_GT LSFT(KC_DOT) // >
-
#define KC_QUES LSFT(KC_SLSH) // ?
#define KC_QUESTION KC_QUES
-
#define KC_DQT LSFT(KC_QUOT) // "
#define KC_DOUBLE_QUOTE KC_DQT
+#define KC_DQUO KC_DQT
#define KC_DELT KC_DELETE // Del key (four letter code)
diff --git a/quantum/matrix.c b/quantum/matrix.c
index d5fd7def8a..412662a794 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -68,8 +68,10 @@ uint8_t matrix_cols(void) {
void matrix_init(void) {
/* frees PORTF by setting the JTD bit twice within four cycles */
- MCUCR |= _BV(JTD);
- MCUCR |= _BV(JTD);
+ #ifdef __AVR_ATmega32U4__
+ MCUCR |= _BV(JTD);
+ MCUCR |= _BV(JTD);
+ #endif
/* initializes the I/O pins */
#if DIODE_DIRECTION == COL2ROW
for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
diff --git a/quantum/quantum.c b/quantum/quantum.c
index c53fb19b4b..d9aaafd616 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -13,6 +13,16 @@ bool process_action_kb(keyrecord_t *record) {
}
__attribute__ ((weak))
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+ return process_record_user(keycode, record);
+}
+
+__attribute__ ((weak))
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+__attribute__ ((weak))
void leader_start(void) {}
__attribute__ ((weak))
@@ -124,6 +134,9 @@ bool process_record_quantum(keyrecord_t *record) {
keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key);
#endif
+ if (!process_record_kb(keycode, record))
+ return false;
+
// This is how you use actions here
// if (keycode == KC_LEAD) {
// action_t action;
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 69a0d8126a..3ce940895d 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -23,6 +23,7 @@
#include "eeconfig.h"
#include <stddef.h>
#include <avr/io.h>
+#include <util/delay.h>
extern uint32_t default_layer_state;
@@ -61,6 +62,9 @@ extern uint32_t default_layer_state;
void matrix_init_kb(void);
void matrix_scan_kb(void);
bool process_action_kb(keyrecord_t *record);
+bool process_record_kb(uint16_t keycode, keyrecord_t *record);
+bool process_record_user(uint16_t keycode, keyrecord_t *record);
+
bool is_music_on(void);
void music_toggle(void);
diff --git a/quantum/quantum.mk b/quantum/quantum.mk
index c099d67939..00d3e81142 100644
--- a/quantum/quantum.mk
+++ b/quantum/quantum.mk
@@ -1,5 +1,9 @@
QUANTUM_DIR = quantum
+ifndef VERBOSE
+.SILENT:
+endif
+
# # project specific files
SRC += $(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/keymap_common.c \
diff --git a/quantum/template/Makefile b/quantum/template/Makefile
index 1a535ef2cb..f101eb7a67 100644
--- a/quantum/template/Makefile
+++ b/quantum/template/Makefile
@@ -123,7 +123,7 @@ KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
-BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 1d384574f6..37be850f84 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -393,12 +393,10 @@ lib: $(LIBNAME)
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
- @echo
@echo $(MSG_BEGIN)
end:
@echo $(MSG_END)
- @echo
# Display size of file.
@@ -505,13 +503,11 @@ COFFCONVERT += --change-section-address .eeprom-0x810000
coff: $(TARGET).elf
- @echo
@echo $(MSG_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
extcoff: $(TARGET).elf
- @echo
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
@@ -519,25 +515,21 @@ extcoff: $(TARGET).elf
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
- @echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
%.eep: %.elf
- @echo
@echo $(MSG_EEPROM) $@
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
# Create extended listing file from ELF output file.
%.lss: %.elf
- @echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S -z $< > $@
# Create a symbol table from ELF output file.
%.sym: %.elf
- @echo
@echo $(MSG_SYMBOL_TABLE) $@
$(NM) -n $< > $@
@@ -547,7 +539,6 @@ extcoff: $(TARGET).elf
.SECONDARY : $(TARGET).a
.PRECIOUS : $(OBJ)
%.a: $(OBJ)
- @echo
@echo $(MSG_CREATING_LIBRARY) $@
$(AR) $@ $(OBJ)
@@ -556,14 +547,12 @@ extcoff: $(TARGET).elf
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
- @echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
# Compile: create object files from C source files.
$(OBJDIR)/%.o : %.c
- @echo
mkdir -p $(@D)
@echo $(MSG_COMPILING) $<
$(CC) -c $(ALL_CFLAGS) $< -o $@
@@ -571,7 +560,6 @@ $(OBJDIR)/%.o : %.c
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
- @echo
mkdir -p $(@D)
@echo $(MSG_COMPILING_CPP) $<
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
@@ -589,7 +577,6 @@ $(OBJDIR)/%.o : %.cpp
# Assemble: create object files from assembler source files.
$(OBJDIR)/%.o : %.S
- @echo
mkdir -p $(@D)
@echo $(MSG_ASSEMBLING) $<
$(CC) -c $(ALL_ASFLAGS) $< -o $@
@@ -604,7 +591,6 @@ $(OBJDIR)/%.o : %.S
clean: begin clean_list end
clean_list :
- @echo
$(REMOVE) $(TARGET).hex
$(REMOVE) $(TARGET).eep
$(REMOVE) $(TARGET).cof