Merge remote-tracking branch 'upstream/master' into infinity60

pull/1349/head
jpetermans 8 years ago
commit 2dcd6c38fa

@ -1,8 +1,7 @@
FROM debian:jessie FROM debian:jessie
MAINTAINER Erik Dasque <erik@frenchguys.com> MAINTAINER Erik Dasque <erik@frenchguys.com>
RUN apt-get update RUN apt-get update && apt-get install --no-install-recommends -y build-essential \
RUN apt-get install --no-install-recommends -y build-essential \
gcc \ gcc \
unzip \ unzip \
wget \ wget \
@ -15,10 +14,8 @@ RUN apt-get install --no-install-recommends -y build-essential \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
binutils-arm-none-eabi \ binutils-arm-none-eabi \
libnewlib-arm-none-eabi \ libnewlib-arm-none-eabi \
git git \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
ENV keyboard=ergodox ENV keyboard=ergodox
ENV subproject=ez ENV subproject=ez

@ -21,6 +21,8 @@ override SILENT := false
ON_ERROR := error_occurred=1 ON_ERROR := error_occurred=1
BREAK_ON_ERRORS = no
STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
ROOT_DIR := $(dir $(ROOT_MAKEFILE)) ROOT_DIR := $(dir $(ROOT_MAKEFILE))
@ -462,20 +464,25 @@ endef
include $(ROOT_DIR)/message.mk 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 # 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 # Otherwise the command line will become too long with a lot of keyboards and keymaps
define RUN_COMMAND define RUN_COMMAND
+error_occurred=0;\ +error_occurred=0;\
$(COMMAND_$(SILENT_MODE)_$(COMMAND))\ $(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 endef
define RUN_TEST define RUN_TEST
+error_occurred=0;\ +error_occurred=0;\
$($(TEST)_COMMAND)\ $($(TEST)_COMMAND)\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi; if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef endef
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps # Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
@ -527,14 +534,22 @@ test: test-all
.PHONY: test-clean .PHONY: test-clean
test-clean: test-all-clean test-clean: test-all-clean
ifdef SKIP_VERSION
SKIP_GIT := yes
endif
# Generate the version.h file # Generate the version.h file
ifndef SKIP_GIT ifndef SKIP_GIT
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
else else
GIT_VERSION := NA GIT_VERSION := NA
endif endif
ifndef SKIP_VERSION
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") 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_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(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 include $(ROOT_DIR)/testlist.mk

@ -176,26 +176,32 @@ endif
ifeq ($(strip $(UCIS_ENABLE)), yes) ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE OPT_DEFS += -DUCIS_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
endif endif
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE OPT_DEFS += -DUNICODEMAP_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
endif endif
ifeq ($(strip $(UNICODE_ENABLE)), yes) ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE OPT_DEFS += -DUNICODE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
endif endif
ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
OPT_DEFS += -DRGBLIGHT_ENABLE OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/light_ws2812.c SRC += $(QUANTUM_DIR)/light_ws2812.c
SRC += $(QUANTUM_DIR)/rgblight.c SRC += $(QUANTUM_DIR)/rgblight.c
CIE1931_CURVE = yes
LED_BREATHING_TABLE = yes
endif endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
@ -223,6 +229,28 @@ ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
endif endif
endif endif
ifeq ($(strip $(LCD_ENABLE)), yes)
CIE1931_CURVE = yes
endif
ifeq ($(strip $(LED_ENABLE)), yes)
CIE1931_CURVE = yes
endif
ifeq ($(strip $(CIE1931_CURVE)), yes)
OPT_DEFS += -DUSE_CIE1931_CURVE
LED_TABLES = yes
endif
ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
OPT_DEFS += -DUSE_LED_BREATHING_TABLE
LED_TABLES = yes
endif
ifeq ($(strip $(LED_TABLES)), yes)
SRC += $(QUANTUM_DIR)/led_tables.c
endif
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax
@ -258,12 +286,12 @@ endif
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC) $(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) $(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target. # Default target.

@ -147,6 +147,21 @@
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
} }
#define KEYMAP_MAX( \
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, 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, XXX, 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} \
}
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

@ -0,0 +1,61 @@
// 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
// dual-role shortcuts
#define SPACEDUAL LT(_SPC, KC_SPACE)
// increase readability
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _DEF: Default Layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | ~ |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| bspc|
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '| Return |
* |-----------------------------------------------------------|
* |Sft | Fn0| Z| X| C| V| B| N| M| ,| .| /| Sft |Fn2|
* |-----------------------------------------------------------|
* |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl|
* `-----------------------------------------------------------'
*/
[_DEF] = KEYMAP_MAX(
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_BSLS, KC_GRV, \
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_BSPC, \
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_LSFT, F(0), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, F(1), \
KC_LCTL, KC_LALT, KC_LGUI, SPACEDUAL, KC_RGUI, KC_RALT, KC_RCTL, F(2)),
/* 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| | |
* |-----------------------------------------------------------|
* | |Paus| Up| [ | ] | | | | ( | ) | | | | Del |
* |-----------------------------------------------------------|
* | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
* |-----------------------------------------------------------|
* | | | | | < | > | |M0 | | | | | Vol+ | |
* |-----------------------------------------------------------|
* | | | | |Alt |Prev|Vol-|Next|
* `-----------------------------------------------------------'
*/
[_SPC] = KEYMAP_MAX(
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_PAUS, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, KC_MPLY, \
_______, _______, _______, _______, _______, _______, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \
_______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
};

@ -39,7 +39,22 @@
{k40, k41, k42, k43}, \ {k40, k41, k42, k43}, \
{k50, XXX, k52, XXX} \ {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_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

@ -0,0 +1,102 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// 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 _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* |Esc |Setp| - | = |
* |----|----|----|----|
* | F1 | F2 | F3 | F4 |
* |----|----|----|----|
* | 7 | 8 | 9 | - |
* |----|----|----|----|
* | 4 | 5 | 6 | LF |
* |----|----|----|----|
* | 1 | 2 | 3 | \ |
* |----|----|----|----|
* |Left|Down| Up |Rght|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_ESC, KC_TAB, KC_MINS,KC_EQL, \
KC_F1, KC_F2, KC_F3, KC_F4, \
KC_P7, KC_P8, KC_P9, KC_PMNS, \
KC_P4, KC_P5, KC_P6, KC_PENT, \
KC_P1, KC_P2, KC_P3, KC_BSLS, \
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
/* Keymap _FL: Function Layer
* ,-------------------.
* |Esc |TAB |BS | = |
* |----|----|----|----|
* | NL | / | * | - |
* |----|----|----|----|
* | 7 | 8 | 9 | |
* |----|----|----|RST |
* | 4 | 5 | 6 | |
* |----|----|----|----|
* | 1 | 2 | 3 | |
* |----|----|----| En |
* | 0 |./FN| |
* `-------------------'
*/
[_FL] = MAXKEYMAP(
KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
KC_P7, KC_P8, KC_P9, RESET, \
KC_P4, KC_P5, KC_P6, KC_PENT, \
KC_P1, KC_P2, KC_P3, KC_PENT, \
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
};
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

@ -0,0 +1,65 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// 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 _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* | T | G | B |Spac|
* |----|----|----|----|
* | R | F | V | Fn |
* |----|----|----|----|
* | E | D | C | OS |
* |----|----|----|----|
* | W | S | X | Alt|
* |----|----|----|----|
* | Q | A | Z | Ctl|
* |----|----|----|----|
* | Esc| Tab|Shft| Fn2|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_T, KC_G, KC_B, KC_SPACE,\
KC_R, KC_F, KC_V, MO(1), \
KC_E, KC_D, KC_C, KC_LGUI, \
KC_W, KC_S, KC_X, KC_LALT, \
KC_Q, KC_A, KC_Z, KC_LCTL, \
KC_TAB, KC_ESC, KC_LSHIFT, MO(1)),
/* Keymap _FL: Function Layer
* ,-------------------.
* | 5 | F5 | F11|Spac|
* |----|----|----|----|
* | 4 | F4 | F10| |
* |----|----|----|----|
* | 3 | F3 | F9 | OS |
* |----|----|----|----|
* | 2 | F2 | F8 | Alt|
* |----|----|----|----|
* | 1 | F1 | F7 | Ctl|
* |----|----|----|----|
* | ` | Del|Shft| |
* `-------------------'
*/
[_FL] = MAXKEYMAP(
KC_5, KC_F5, KC_F11, _______, \
KC_4, KC_F4, KC_F10, _______, \
KC_3, KC_F3, KC_F9, _______, \
KC_2, KC_F2, KC_F8, _______, \
KC_1, KC_F1, KC_F7, _______, \
KC_GRV,KC_DEL, _______, _______),
};

@ -0,0 +1,65 @@
#include "amjpad.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// 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 _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-------------------.
* |Spac| N | H | Y |
* |----|----|----|----|
* | Fn | M | J | U |
* |----|----|----|----|
* |Left| , | K | I |
* |----|----|----|----|
* |Down| . | L | O |
* |----|----|----|----|
* | Up | / | ; | P |
* |----|----|----|----|
* |Rght| Ret| " |Bspc|
* `-------------------'
*/
[_BL] = MAXKEYMAP(
KC_SPACE, KC_N, KC_H, KC_Y, \
MO(1), KC_M, KC_J, KC_U, \
KC_LEFT, KC_COMM, KC_K, KC_I, \
KC_DOWN, KC_DOT, KC_L, KC_O, \
KC_UP, KC_SLASH, KC_SCLN, KC_P, \
KC_RIGHT, KC_ENT, KC_QUOT, KC_BSPC),
/* Keymap _FL: Function Layer
* ,-------------------.
* |Esc | F12| F6 | 6 |
* |----|----|----|----|
* | NL | M | - | 7 |
* |----|----|----|----|
* |Left| , | = | 8 |
* |----|----|----|----|
* |Down| . | [ | 9 |
* |----|----|----|----|
* | Up | / | ] | 0 |
* |----|----|----|----|
* |Rght| Ret| \ | Del|
* `-------------------'
*/
[_FL] = MAXKEYMAP(
_______, KC_F12, KC_F6, KC_6, \
_______, _______, KC_MINS, KC_7, \
_______, _______, KC_EQL, KC_8, \
_______, _______, KC_LBRC, KC_9, \
_______, _______, KC_RBRC, KC_0, \
_______, _______, KC_BSLS, KC_DEL),
};

@ -255,7 +255,7 @@ float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
#endif /* AUDIO_ENABLE */ #endif /* AUDIO_ENABLE */
void persistant_default_layer_set(uint16_t default_layer) void persistent_default_layer_set(uint16_t default_layer)
{ {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
@ -366,7 +366,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_QWERTY: case MACRO_QWERTY:
if (record->event.pressed) if (record->event.pressed)
{ {
persistant_default_layer_set(1UL<<LAYER_QWERTY); persistent_default_layer_set(1UL<<LAYER_QWERTY);
} }
break; break;

@ -39,8 +39,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LW] = { /* [> LOWER <] */ [_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_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_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11},
{KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, RESET, KC_LCTL, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12}, {KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_LCTL, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12},
{KC_TRNS, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, DF(_QW), KC_PSCR, KC_SLCK, KC_PAUS} {KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS}
}}; }};
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {

@ -12,78 +12,213 @@ extern keymap_config_t keymap_config;
// The underscores don't mean anything - you can have a layer called STUFF or any other name. // 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 // Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers. // entirely and just use numbers.
#define _DV 0 #define _DVORAK 0
#define _QW 1 #define _QWERTY 1
#define _CM 2 #define _COLEMAK 2
#define _L1 3 #define _DVORMAC 3
#define _L2 4 #define _LOWER 4
#define _RAISE 5
#define _ADJUST 16
// Macro name shortcuts enum planck_keycodes {
#define DVORAK M(_DV) DVORAK = SAFE_RANGE,
#define QWERTY M(_QW) QWERTY,
#define COLEMAK M(_CM) COLEMAK,
DVORMAC,
LOWER,
RAISE,
BACKLIT
};
// Adding macros to make the keymaps below much easier to read.
#define SFTSCLN SFT_T(KC_SCLN)
#define SFTSLSH SFT_T(KC_SLSH)
#define SFTZED SFT_T(KC_Z)
#define ALTENT ALT_T(KC_ENT)
#define ESCTRL CTL_T(KC_ESC)
#define TABALT ALT_T(KC_TAB)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* Dvorak */ /* Dvorak Layer
{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 }, | ' | , | . | P | Y | | F | G | C | R | L |
{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} | A | O | E | U | I | | D | H | T | N | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |SFT/ Z|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------' */
[_DVORAK] = {
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCTL, KC_B, KC_M, KC_W, KC_V, SFTZED },
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
},
/* QWERTY Layer
,----------------------------------. ,----------------------------------.
| Q | W | E | R | T | | Y | U | I | O | P |
|------+------+------+------+------| |------+------+------+------+------|
| A | S | D | F | G | | H | J | K | L | ; |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |SFT/ /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------' */
[_QWERTY] = {
{KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
{SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_N, KC_M, KC_COMM, KC_DOT, SFTSLSH},
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
},
/* Colemak Layer
,----------------------------------. ,----------------------------------.
| Q | W | F | P | G | | J | L | U | Y | L |
|------+------+------+------+------| |------+------+------+------+------|
| A | R | S | T | D | | H | N | E | I | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |SFT/ /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'*/
[_COLEMAK] = {
{KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
{KC_A, KC_R, KC_S, KC_T, KC_D, XXXXXXX, KC_H, KC_N, KC_E, KC_I, KC_O },
{SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_K, KC_M, KC_COMM, KC_DOT, SFTSLSH},
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
}, },
[_QW] = { /* Qwerty */
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, /* Dvorak Layer with Command key on left thumb instead of Control
{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) }, | ' | , | . | P | Y | | F | G | C | R | L |
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_EQL} |------+------+------+------+------| |------+------+------+------+------|
| A | O | E | U | I | | D | H | T | N | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ ;| Q | J | K | X | CMD ||Alt / | B | M | W | V |SFT/ Z|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------' */
[_DVORMAC] = {
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, KC_B, KC_M, KC_W, KC_V, SFTZED },
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
}, },
[_CM] = { /* Colemak */
{KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, /* LOWER Layer
{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_EQL} |------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | + | { | } |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
|------+------+------+------+------| || |------+------+------+------+------|
| ~ | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'*/
[_LOWER] = {
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_PLUS, KC_LCBR, KC_RCBR},
{_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, _______},
{KC_TILD, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
}, },
[_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 }, /* RAISE Layer
{KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS}, ,----------------------------------. ,----------------------------------.
{KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
{KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } |------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | = | [ | ] |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
|------+------+------+------+------| || |------+------+------+------+------|
| ` | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'*/
[_RAISE] = {
{KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0 },
{KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_EQL, KC_LBRC, KC_RBRC},
{_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, _______},
{KC_GRV, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
}, },
[_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}, /* ADJUST Layer
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PIPE}, ,----------------------------------. ,----------------------------------.
{KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
{KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} |------+------+------+------+------| |------+------+------+------+------|
| F11 | | | | | | | PrSc | ScLk | Paus | F12 |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
|------+------+------+------+------| || |------+------+------+------+------|
| | | | | |------'`------| | | | | RESET|
`----------------------------------' `----------------------------------'*/
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 },
{KC_F11, _______, _______, _______, _______, XXXXXXX, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_F12 },
{_______, QWERTY, COLEMAK, DVORAK, DVORMAC, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
} }
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) bool process_record_user(uint16_t keycode, keyrecord_t *record) {
{ switch (keycode) {
switch(id) { case QWERTY:
case _DV: if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case DVORMAC:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DVORMAC);
} }
return false;
break; break;
case _QW: case LOWER:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false;
break; break;
case _CM: case RAISE:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false;
break; break;
} }
return MACRO_NONE; return true;
}; };

@ -0,0 +1,107 @@
# Xyverz's Atreus Keymap
## About this keymap:
This is the second iteration of my Atreus keymap. The first one was as close to the planck as I could get at the
time, but still very much like the original Atreus keymap. I've managed to get things working better now and have
implemented (more like copied) the RAISE/LOWER/ADJUST layers. This is a work in progress, but I think I'm closer
to a final go with this.
I'm using MOD_TAP quite a bit in this keymap. On all layers, R4 pinky keys use mod-tap and are SHIFT when held
and their normal keys when tapped. In addition, ESC and TAB are also set as Ctrl and ALT respectively when held,
and Enter/ALT on the right thumb key for all layers.
I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
Recently added: Documentation, Formatting, and another Dvorak layer that has Command on the left thumb, instead of
Control.
## Still to do:
* Enjoy this revision; figure out new things later.
### Layer 0: Dvorak layer
,----------------------------------. ,----------------------------------.
| ' | , | . | P | Y | | F | G | C | R | L |
|------+------+------+------+------| |------+------+------+------+------|
| A | O | E | U | I | | D | H | T | N | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|Shft ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |Shft Z|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------'
### Layer 1: QWERTY layer
,----------------------------------. ,----------------------------------.
| Q | W | E | R | T | | Y | U | I | O | P |
|------+------+------+------+------| |------+------+------+------+------|
| A | S | D | F | G | | H | J | K | L | ; |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|Shft Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |Shft /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'
### Keymap 2: Colemak layer
,----------------------------------. ,----------------------------------.
| Q | W | F | P | G | | J | L | U | Y | L |
|------+------+------+------+------| |------+------+------+------+------|
| A | R | S | T | D | | H | N | E | I | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|Shft Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |Shft /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'
### Keymap 3: Dvorak for Mac layout
,----------------------------------. ,----------------------------------.
| ' | , | . | P | Y | | F | G | C | R | L |
|------+------+------+------+------| |------+------+------+------+------|
| A | O | E | U | I | | D | H | T | N | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ ;| Q | J | K | X | CMD ||Alt / | B | M | W | V |SFT/ Z|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------'
### Keymap 4: LOWER layer
,----------------------------------. ,----------------------------------.
| ! | @ | # | $ | % | | ^ | & | * | ( | ) |
|------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | + | { | } |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
|------+------+------+------+------| || |------+------+------+------+------|
| ~ | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'
### Keymap 5: RAISE layer
,----------------------------------. ,----------------------------------.
| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
|------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | = | [ | ] |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
|------+------+------+------+------| || |------+------+------+------+------|
| ` | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'
### Keymap 6: ADJUST layer
,----------------------------------. ,----------------------------------.
| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
|------+------+------+------+------| |------+------+------+------+------|
| F11 | | | | | | | PScr | SLck | Paus | F12 |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
|------+------+------+------+------| || |------+------+------+------+------|
| | | | | |------'`------| | | | | RESET|
`----------------------------------' `----------------------------------'

@ -119,7 +119,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -128,25 +128,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;
case WOW: case WOW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_WOW); persistent_default_layer_set(1UL<<_WOW);
} }
return false; return false;
break; break;

@ -50,35 +50,28 @@ const uint16_t PROGMEM fn_actions[] = {
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed; static uint8_t mods_pressed;
static bool mod_flag;
switch (id) { switch (id) {
case 0: case 0:
/* Handle the combined Grave/Esc key /* Handle the combined Grave/Esc key
*/ */
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (record->event.pressed) { if (record->event.pressed) {
/* The key is being pressed. /* The key is being pressed.
*/ */
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (mods_pressed) { if (mods_pressed) {
mod_flag = true; register_code(KC_GRV);
add_key(KC_GRV);
send_keyboard_report();
} else { } else {
add_key(KC_ESC); register_code(KC_ESC);
send_keyboard_report();
} }
} else { } else {
/* The key is being released. /* The key is being released.
*/ */
if (mod_flag) { if (mods_pressed) {
mod_flag = false; mods_pressed = false;
del_key(KC_GRV); unregister_code(KC_GRV);
send_keyboard_report();
} else { } else {
del_key(KC_ESC); unregister_code(KC_ESC);
send_keyboard_report();
} }
} }
break; break;

@ -0,0 +1,4 @@
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes

@ -0,0 +1,103 @@
#include "clueboard.h"
// Helpful defines
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
#define _______ KC_TRNS
// 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 _BL 0
#define _FL 1
#define _ME 2
#define _CL 3
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: Base Layer (Default Layer)
*/
[_BL] = KEYMAP(
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_GRV, KC_BSPC, KC_PGUP, \
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_PGDN, \
F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RGUI, MO(_FL), MO(_ME), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
[_FL] = KEYMAP(
KC_ESC, 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_HOME, \
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_PSCR, KC_END, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_HOME, KC_PGDN, KC_END),
/* Keymap _FL: Function Layer
*/
[_ME] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, KC_VOLD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______ , _______, _______, \
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_MPRV, KC_MPLY, KC_MNXT),
/* Keymap _CL: Control layer
*/
[_CL] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, MO(_FL), _______, RGB_SAI, \
_______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
};
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), // Calls action_function()
[1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
static bool mod_flag;
switch (id) {
case 0:
/* Handle the combined Grave/Esc key
*/
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (record->event.pressed) {
/* The key is being pressed.
*/
if (mods_pressed) {
mod_flag = true;
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
/* The key is being released.
*/
if (mod_flag) {
mod_flag = false;
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
case 1:
if(record->event.pressed) {
del_key(KC_ESC);
}
break;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@ -0,0 +1,23 @@
```
___ _____ _ _ _ __ __ _ __
|__ \ / ____| | | | | | / / / /(_) / /
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
```
# Serubin's Clueboard Layout
This is the layout based on the clueboard default, modified for development on Mac, PC, and Windows. This layout also handles media and volume keys on all the previously listed platforms. Most importantly, Capslock has been replaced by a dual function Esc/Ctrl key. This is particularly handy for use in Vim.
#### Base Layer
![Base Layout Image](layout-base.png)
#### Fn Layer
![Fn Layout Image](layout-fn.png)
#### Media Layer
![Media Layer Image](layout-media.png)

@ -19,17 +19,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
F(0), 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_GRV, KC_BSPC, KC_PGUP, \ F(0), 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_GRV, KC_BSPC, KC_PGUP, \
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_PGDN, \ 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_PGDN, \
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_NUHS, KC_ENT, \ 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_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LGUI, KC_LALT,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
*/ */
[_FL] = KEYMAP( [_FL] = KEYMAP(
S(KC_GRV), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, \ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, \
S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \ S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \ S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \ MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
KC_LCTL, KC_LALT, KC_LGUI,MO(_FL), S(KC_SPC),S(KC_SPC), MO(_FL), KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer /* Keymap _CL: Control layer
*/ */

@ -19,30 +19,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
F(0), 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_GRV, KC_BSPC, KC_PGUP, \ F(0), 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_GRV, KC_BSPC, KC_PGUP, \
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_PGDN, \ 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_PGDN, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL,KC_LALT,KC_LGUI,MO(_FL), KC_SPC, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
*/ */
[_FL] = KEYMAP( [_FL] = KEYMAP(
KC_GRV, 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, BL_STEP, \ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, \
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______, \ S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
_______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_PGUP, \ MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
_______,_______,_______,MO(_FL), _______,_______, MO(_FL),_______,_______,MO(_FL),KC_HOME,KC_PGDN,KC_END), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer /* Keymap _CL: Control layer
*/ */
[_CL] = KEYMAP( [_CL] = KEYMAP(
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
_______,_______,_______,_______, _______,_______, _______,_______,_______,MO(_FL),_______, _______, _______), _______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD,RGB_SAD,RGB_HUI),
}; };
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), [0] = ACTION_FUNCTION(0), // Calls action_function()
}; };
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

@ -0,0 +1,181 @@
#include "clueboard.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 _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _FL 3
#define _CL 4
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK
};
// Helpful defines
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
// Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt)
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _QWERTY: Base Layer (Default Layer)
* ,-----------------------------------------------------------. ,---.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| |PgU|
* |-----------------------------------------------------------| |---|
* |HpTab| Q| W| E| R| T| Y| U| I| O| P| [| ]| BS| |PgD|
* |-----------------------------------------------------------| `---'
* |CtlEsc| A| S| D| F| G| H| J| K| L| ;| '| | Ent|
* |--------------------------------------------------------------.
* |Shift| | Z| X| C| V| B| N| M| ,| .| /|Shift| Fn| Up|
* |------------------------------------------------------------------.
* |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
* `------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP(
F(0), 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_BSLS, KC_GRV, KC_PGUP, \
HPR_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_BSPC, KC_PGDN, \
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, MO(_FL), KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _COLEMAK: Base Layer
* ,-----------------------------------------------------------. ,---.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| |PgU|
* |-----------------------------------------------------------| |---|
* |HpTab| Q| W| F| P| G| J| L| U| Y| ;| [| ]| BS| |PgD|
* |-----------------------------------------------------------| `---'
* |CtlEsc| A| R| S| T| D| H| N| E| I| O| '| | Ent|
* |--------------------------------------------------------------.
* |Shift| | Z| X| C| V| B| K| M| ,| .| /|Shift| Fn| Up|
* |------------------------------------------------------------------.
* |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
* `------------------------------------------------------------------'
*/
[_COLEMAK] = KEYMAP(
F(0), 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_BSLS, KC_GRV, KC_PGUP, \
HPR_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_BSPC, KC_PGDN, \
CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, \
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, MO(_FL), KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _DVORAK: Base Layer
* ,-----------------------------------------------------------. ,---.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `| |PgU|
* |-----------------------------------------------------------| |---|
* |HpTab| '| ,| .| P| Y| F| G| C| R| L| /| =| BS| |PgD|
* |-----------------------------------------------------------| `---'
* |CtlEsc| A| O| E| U| I| D| H| T| N| S| -| | Ent|
* |--------------------------------------------------------------.
* |Shift| | ;| Q| J| K| X| B| M| W| V| Z|Shift| Fn| Up|
* |------------------------------------------------------------------.
* |Ctrl|Gui|Alt | | Space| Space| |Alt |Gui |Ctrl|Left|Down|Rgt|
* `------------------------------------------------------------------'
*/
[_DVORAK] = KEYMAP(
F(0), 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_BSLS, KC_GRV, KC_PGUP, \
HPR_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_BSPC, KC_PGDN, \
CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, \
KC_LSFT, XXXXXXX, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, MO(_FL), KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, KC_SPC,KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, BL_STEP, \
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_DEL, _______, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), KC_PGUP, \
_______, _______, _______, _______, _______,_______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer
*/
[_CL] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______, _______, _______,_______,RESET, _______,_______,QWERTY, COLEMAK,DVORAK, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
_______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
};
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), // Calls action_function()
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
static bool mod_flag;
switch (id) {
case 0:
/* Handle the combined Grave/Esc key
*/
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (record->event.pressed) {
/* The key is being pressed.
*/
if (mods_pressed) {
mod_flag = true;
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
/* The key is being released.
*/
if (mod_flag) {
mod_flag = false;
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
}
return true;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

@ -0,0 +1,30 @@
```
___ _____ _ _ _ __ __ _ __
|__ \ / ____| | | | | | / / / /(_) / /
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
```
# smt Clueboard Layout (HHKB variant)
![Clueboard Layout Image](layout.png)
This is smt's HHKB variant layout, based on the default layout that comes
flashed on every Clueboard. The primary differences from the default are:
- The Backspace key is moved down into the traditional `\` position
- `\` and `` ` `` are assigned to the "split-backspace" positions
- The right Shift is split to allow for a Fn key to its right
- The modifiers on the right side now mirror the left side (`Alt`/`Super`/`Ctrl`)
For the most part, it's a straightforward and easy to follow layout. There
are a few special keys:
- The Esc key sends `Esc` when tapped, `` ` `` when `Alt`/`Super`/`Ctrl`/`Fn` is held, or `~` when `Shift` is held
- The Tab key sends `Tab` when tapped, or `Super+Ctrl+Alt+Shift` (a.k.a. [Hyper]) when held
- The key traditionally in the Caps-Lock position has been re-mapped to send `Esc` when tapped, or `Ctrl` when held
- The left Shift key sends `Enter` when tapped, or `Shift` when held
[Hyper]: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/

@ -256,7 +256,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -266,25 +266,25 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
/* layout switcher */ /* layout switcher */
case LAY_QWE: case LAY_QWE:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<QWE); persistent_default_layer_set(1UL<<QWE);
} }
return false; return false;
break; break;
case LAY_COL: case LAY_COL:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<COL); persistent_default_layer_set(1UL<<COL);
} }
return false; return false;
break; break;
case LAY_WOR: case LAY_WOR:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<WOR); persistent_default_layer_set(1UL<<WOR);
} }
return false; return false;
break; break;
case LAY_DVO: case LAY_DVO:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<DVO); persistent_default_layer_set(1UL<<DVO);
} }
return false; return false;
break; break;

@ -3,8 +3,8 @@
#define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_DELAY 0 #define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 5 #define MOUSEKEY_TIME_TO_MAX 40
#define MOUSEKEY_MAX_SPEED 2 #define MOUSEKEY_MAX_SPEED 7
#define MOUSEKEY_WHEEL_DELAY 0 #define MOUSEKEY_WHEEL_DELAY 0
#define TAPPING_TOGGLE 1 #define TAPPING_TOGGLE 1

@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBW 1 #define RGBW 1
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 15
#define USB_MAX_POWER_CONSUMPTION 500 #define USB_MAX_POWER_CONSUMPTION 500

@ -53,11 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef DEBOUNCE #ifndef DEBOUNCE
# define DEBOUNCE 5 # define DEBOUNCE 5
#endif #endif
static uint8_t debouncing = DEBOUNCE;
/* matrix state(1:on, 0:off) */ /* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
// Debouncing: store for each key the number of scans until it's eligible to
// change. When scanning the matrix, ignore any changes in keys that have
// already changed in the last DEBOUNCE scans.
static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
static matrix_row_t read_cols(uint8_t row); static matrix_row_t read_cols(uint8_t row);
static void init_cols(void); static void init_cols(void);
@ -113,7 +116,9 @@ void matrix_init(void)
// initialize matrix state: all keys off // initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) { for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0; matrix[i] = 0;
matrix_debouncing[i] = 0; for (uint8_t j=0; j < MATRIX_COLS; ++j) {
debounce_matrix[i * MATRIX_COLS + j] = 0;
}
} }
#ifdef DEBUG_MATRIX_SCAN_RATE #ifdef DEBUG_MATRIX_SCAN_RATE
@ -134,14 +139,36 @@ void matrix_power_up(void) {
// initialize matrix state: all keys off // initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) { for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0; matrix[i] = 0;
matrix_debouncing[i] = 0;
} }
#ifdef DEBUG_MATRIX_SCAN_RATE #ifdef DEBUG_MATRIX_SCAN_RATE
matrix_timer = timer_read32(); matrix_timer = timer_read32();
matrix_scan_count = 0; matrix_scan_count = 0;
#endif #endif
}
// Returns a matrix_row_t whose bits are set if the corresponding key should be
// eligible to change in this scan.
matrix_row_t debounce_mask(uint8_t row) {
matrix_row_t result = 0;
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
if (debounce_matrix[row * MATRIX_COLS + j]) {
--debounce_matrix[row * MATRIX_COLS + j];
} else {
result |= (1 << j);
}
}
return result;
}
// Report changed keys in the given row. Resets the debounce countdowns
// corresponding to each set bit in 'change' to DEBOUNCE.
void debounce_report(matrix_row_t change, uint8_t row) {
for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
if (change & (1 << i)) {
debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
}
}
} }
uint8_t matrix_scan(void) uint8_t matrix_scan(void)
@ -178,26 +205,12 @@ uint8_t matrix_scan(void)
for (uint8_t i = 0; i < MATRIX_ROWS; i++) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
select_row(i); select_row(i);
wait_us(30); // without this wait read unstable value. wait_us(30); // without this wait read unstable value.
matrix_row_t cols = read_cols(i); matrix_row_t mask = debounce_mask(i);
if (matrix_debouncing[i] != cols) { matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
matrix_debouncing[i] = cols; debounce_report(cols ^ matrix[i], i);
if (debouncing) { matrix[i] = cols;
debug("bounce!: "); debug_hex(debouncing); debug("\n");
}
debouncing = DEBOUNCE;
}
unselect_rows();
}
if (debouncing) { unselect_rows();
if (--debouncing) {
wait_us(1);
// this should be wait_ms(1) but has been left as-is at EZ's request
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
}
} }
matrix_scan_quantum(); matrix_scan_quantum();
@ -205,9 +218,8 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) bool matrix_is_modified(void) // deprecated and evidently not called.
{ {
if (debouncing) return false;
return true; return true;
} }

@ -74,7 +74,3 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
SLEEP_LED_ENABLE = no SLEEP_LED_ENABLE = no
API_SYSEX_ENABLE ?= no API_SYSEX_ENABLE ?= no
RGBLIGHT_ENABLE ?= yes RGBLIGHT_ENABLE ?= yes
ifndef QUANTUM_DIR
include ../../../Makefile
endif

@ -0,0 +1,107 @@
/* Copyright 2017 Fred Sundvik
*
* 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/>.
*/
#if defined(VISUALIZER_ENABLE)
#include "animations.h"
#include "visualizer.h"
#ifdef LCD_ENABLE
#include "lcd_keyframes.h"
#endif
#ifdef LCD_BACKLIGHT_ENABLE
#include "lcd_backlight_keyframes.h"
#endif
#ifdef LED_ENABLE
#include "led_keyframes.h"
#endif
#include "visualizer_keyframes.h"
#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
// Don't worry, if the startup animation is long, you can use the keyboard like normal
// during that time
keyframe_animation_t default_startup_animation = {
.num_frames = 4,
.loop = false,
.frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0},
.frame_functions = {
lcd_keyframe_enable,
backlight_keyframe_enable,
lcd_keyframe_draw_logo,
backlight_keyframe_animate_color,
},
};
keyframe_animation_t default_suspend_animation = {
.num_frames = 4,
.loop = false,
.frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
.frame_functions = {
lcd_keyframe_display_layer_text,
backlight_keyframe_animate_color,
lcd_keyframe_disable,
backlight_keyframe_disable,
},
};
#endif
#if defined(LED_ENABLE)
#define CROSSFADE_TIME 1000
#define GRADIENT_TIME 3000
keyframe_animation_t led_test_animation = {
.num_frames = 14,
.loop = true,
.frame_lengths = {
gfxMillisecondsToTicks(1000), // fade in
gfxMillisecondsToTicks(1000), // no op (leds on)
gfxMillisecondsToTicks(1000), // fade out
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
0, // mirror leds
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
0, // normal leds
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
},
.frame_functions = {
led_keyframe_fade_in_all,
keyframe_no_operation,
led_keyframe_fade_out_all,
led_keyframe_crossfade,
led_keyframe_left_to_right_gradient,
led_keyframe_crossfade,
led_keyframe_top_to_bottom_gradient,
led_keyframe_mirror_orientation,
led_keyframe_crossfade,
led_keyframe_left_to_right_gradient,
led_keyframe_crossfade,
led_keyframe_top_to_bottom_gradient,
led_keyframe_normal_orientation,
led_keyframe_crossfade,
},
};
#endif
#endif

@ -0,0 +1,30 @@
/* Copyright 2017 Fred Sundvik
*
* 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 KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
#include "visualizer.h"
// You can use these default animations, but of course you can also write your own custom ones instead
extern keyframe_animation_t default_startup_animation;
extern keyframe_animation_t default_suspend_animation;
// An animation for testing and demonstrating the led support, should probably not be used for real world
// cases
extern keyframe_animation_t led_test_animation;
#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */

@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* number of backlight levels */ /* number of backlight levels */
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define LED_BRIGHTNESS_LO 15 #define LED_BRIGHTNESS_LO 100
#define LED_BRIGHTNESS_HI 255 #define LED_BRIGHTNESS_HI 255
/* define if matrix has ghost */ /* define if matrix has ghost */
@ -54,6 +54,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// The visualizer needs gfx thread priorities // The visualizer needs gfx thread priorities
#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) #define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
#define VISUALIZER_USER_DATA_SIZE 16
/* /*
* Feature disable options * Feature disable options
* These options are also useful to firmware size reduction. * These options are also useful to firmware size reduction.

@ -25,6 +25,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "board_IS31FL3731C.h" #include "board_IS31FL3731C.h"
// Can't include led_tables from here
extern const uint8_t CIE1931_CURVE[];
/*===========================================================================*/ /*===========================================================================*/
/* Driver local definitions. */ /* Driver local definitions. */
/*===========================================================================*/ /*===========================================================================*/
@ -100,37 +104,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS31 #define IS31
//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm
const unsigned char cie[256] = {
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
242, 245, 247, 250, 252, 255,
};
/*===========================================================================*/ /*===========================================================================*/
/* Driver local functions. */ /* Driver local functions. */
/*===========================================================================*/ /*===========================================================================*/
@ -231,7 +204,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
uint8_t* src = PRIV(g)->frame_buffer; uint8_t* src = PRIV(g)->frame_buffer;
for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) { for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) {
for (int x=0;x<GDISP_SCREEN_WIDTH;x++) { for (int x=0;x<GDISP_SCREEN_WIDTH;x++) {
PRIV(g)->write_buffer[get_led_address(g, x, y)]=cie[*src]; PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[*src];
++src; ++src;
} }
} }

@ -8,8 +8,6 @@
#ifndef _GDISP_LLD_BOARD_H #ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H
#include "print.h"
#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 #define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6
#define ST7565_ADC ST7565_ADC_NORMAL #define ST7565_ADC ST7565_ADC_NORMAL
#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC #define ST7565_COM_SCAN ST7565_COM_SCAN_DEC
@ -39,35 +37,49 @@
// MSB First // MSB First
// CLK Low by default // CLK Low by default
static const SPIConfig spi1config = { static const SPIConfig spi1config = {
NULL, // Operation complete callback or @p NULL.
/* HW dependent part.*/ .end_cb = NULL,
ST7565_GPIOPORT, //The chip select line port - when not using pcs.
ST7565_SS_PIN, .ssport = ST7565_GPIOPORT,
SPIx_CTARn_FMSZ(7) // brief The chip select line pad number - when not using pcs.
| SPIx_CTARn_ASC(7) .sspad=ST7565_SS_PIN,
| SPIx_CTARn_DT(7) // SPI initialization data.
| SPIx_CTARn_CSSCK(7) .tar0 =
| SPIx_CTARn_PBR(0) SPIx_CTARn_FMSZ(7) // Frame size = 8 bytes
| SPIx_CTARn_BR(7) | SPIx_CTARn_ASC(1) // After SCK Delay Scaler (min 50 ns) = 55.56ns
//SPI_CR1_BR_0 | SPIx_CTARn_DT(0) // Delay After Transfer Scaler (no minimum)= 27.78ns
| SPIx_CTARn_CSSCK(0) // PCS to SCK Delay Scaler (min 20 ns) = 27.78ns
| SPIx_CTARn_PBR(0) // Baud Rate Prescaler = 2
| SPIx_CTARn_BR(0) // Baud rate (min 50ns) = 55.56ns
}; };
static bool_t st7565_is_data_mode = 1; static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to acquire
// spiAcquireBus(&SPID1);
spiSelect(&SPID1);
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to release
//spiReleaseBus(&SPID1);
spiUnselect(&SPID1);
}
static GFXINLINE void init_board(GDisplay *g) { static GFXINLINE void init_board(GDisplay *g) {
(void) g; (void) g;
palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
st7565_is_data_mode = 1;
palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
palSetPadModeRaw(MOSI, ST7565_SPI_MODE); palSetPadModeRaw(MOSI, ST7565_SPI_MODE);
palSetPadModeRaw(SLCK, ST7565_SPI_MODE); palSetPadModeRaw(SLCK, ST7565_SPI_MODE);
palSetPadModeRaw(SS, ST7565_SPI_MODE); palSetPadModeNamed(SS, PAL_MODE_OUTPUT_PUSHPULL);
spiInit(); spiInit();
spiStart(&SPID1, &spi1config); spiStart(&SPID1, &spi1config);
spiSelect(&SPID1); release_bus(g);
} }
static GFXINLINE void post_init_board(GDisplay *g) { static GFXINLINE void post_init_board(GDisplay *g) {
@ -84,43 +96,17 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
} }
} }
static GFXINLINE void acquire_bus(GDisplay *g) { static GFXINLINE void enter_data_mode(GDisplay *g) {
(void) g; palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
// Only the LCD is using the SPI bus, so no need to acquire
// spiAcquireBus(&SPID1);
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to release
//spiReleaseBus(&SPID1);
} }
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { static GFXINLINE void enter_cmd_mode(GDisplay *g) {
(void) g;
if (st7565_is_data_mode) {
// The sleeps need to be at lest 10 vs 25 ns respectively
// So let's sleep two ticks, one tick might not be enough
// if we are at the end of the tick
chThdSleep(2);
palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN);
chThdSleep(2);
st7565_is_data_mode = 0;
}
spiSend(&SPID1, 1, &cmd);
} }
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g; (void) g;
if (!st7565_is_data_mode) {
// The sleeps need to be at lest 10 vs 25 ns respectively
// So let's sleep two ticks, one tick might not be enough
// if we are at the end of the tick
chThdSleep(2);
palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
chThdSleep(2);
st7565_is_data_mode = 1;
}
spiSend(&SPID1, length, data); spiSend(&SPID1, length, data);
} }

@ -26,7 +26,7 @@
#define GDISP_SCREEN_WIDTH 128 #define GDISP_SCREEN_WIDTH 128
#endif #endif
#ifndef GDISP_INITIAL_CONTRAST #ifndef GDISP_INITIAL_CONTRAST
#define GDISP_INITIAL_CONTRAST 0 #define GDISP_INITIAL_CONTRAST 35
#endif #endif
#ifndef GDISP_INITIAL_BACKLIGHT #ifndef GDISP_INITIAL_BACKLIGHT
#define GDISP_INITIAL_BACKLIGHT 100 #define GDISP_INITIAL_BACKLIGHT 100
@ -58,12 +58,24 @@
typedef struct{ typedef struct{
bool_t buffer2; bool_t buffer2;
uint8_t data_pos;
uint8_t data[16];
uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8];
}PrivData; }PrivData;
// Some common routines and macros // Some common routines and macros
#define PRIV(g) ((PrivData*)g->priv) #define PRIV(g) ((PrivData*)g->priv)
#define RAM(g) (PRIV(g)->ram) #define RAM(g) (PRIV(g)->ram)
static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) {
PRIV(g)->data[PRIV(g)->data_pos++] = cmd;
}
static GFXINLINE void flush_cmd(GDisplay* g) {
write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
PRIV(g)->data_pos = 0;
}
#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); }
#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); }
@ -89,6 +101,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// The private area is the display surface. // The private area is the display surface.
g->priv = gfxAlloc(sizeof(PrivData)); g->priv = gfxAlloc(sizeof(PrivData));
PRIV(g)->buffer2 = false; PRIV(g)->buffer2 = false;
PRIV(g)->data_pos = 0;
// Initialise the board interface // Initialise the board interface
init_board(g); init_board(g);
@ -98,38 +111,26 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
gfxSleepMilliseconds(20); gfxSleepMilliseconds(20);
setpin_reset(g, FALSE); setpin_reset(g, FALSE);
gfxSleepMilliseconds(20); gfxSleepMilliseconds(20);
acquire_bus(g); acquire_bus(g);
write_cmd(g, ST7565_DISPLAY_OFF); enter_cmd_mode(g);
write_cmd(g, ST7565_RESET);
write_cmd(g, ST7565_LCD_BIAS); write_cmd(g, ST7565_LCD_BIAS);
write_cmd(g, ST7565_ADC); write_cmd(g, ST7565_ADC);
write_cmd(g, ST7565_COM_SCAN); write_cmd(g, ST7565_COM_SCAN);
write_cmd(g, ST7565_START_LINE | 0); write_cmd(g, ST7565_RESISTOR_RATIO | 0x1);
write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST);
write_cmd(g, ST7565_RESISTOR_RATIO | 0x6);
// turn on voltage converter (VC=1, VR=0, VF=0)
write_cmd(g, ST7565_POWER_CONTROL | 0x04);
delay_ms(50);
// turn on voltage regulator (VC=1, VR=1, VF=0)
write_cmd(g, ST7565_POWER_CONTROL | 0x06);
delay_ms(50);
// turn on voltage follower (VC=1, VR=1, VF=1) // turn on internal power supply (VC=1, VR=1, VF=1)
write_cmd(g, ST7565_POWER_CONTROL | 0x07); write_cmd(g, ST7565_POWER_CONTROL | 0x07);
delay_ms(50);
write_cmd(g, 0xE2);
write_cmd(g, ST7565_COM_SCAN);
write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101);
//write_cmd2(g, ST7565_CONTRAST, 0);
write_cmd(g, ST7565_DISPLAY_ON);
write_cmd(g, ST7565_ALLON_NORMAL);
write_cmd(g, ST7565_INVERT_DISPLAY); write_cmd(g, ST7565_INVERT_DISPLAY);
write_cmd(g, ST7565_ALLON_NORMAL);
write_cmd(g, ST7565_START_LINE | 0);
write_cmd(g, ST7565_RMW); write_cmd(g, ST7565_RMW);
flush_cmd(g);
// Finish Init // Finish Init
post_init_board(g); post_init_board(g);
@ -141,7 +142,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0; g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn; g->g.Powermode = powerOff;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST; g->g.Contrast = GDISP_INITIAL_CONTRAST;
return TRUE; return TRUE;
@ -156,16 +157,21 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
return; return;
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0);
for (p = 0; p < 4; p++) { for (p = 0; p < 4; p++) {
write_cmd(g, ST7565_PAGE | (p + dstOffset)); write_cmd(g, ST7565_PAGE | (p + dstOffset));
write_cmd(g, ST7565_COLUMN_MSB | 0); write_cmd(g, ST7565_COLUMN_MSB | 0);
write_cmd(g, ST7565_COLUMN_LSB | 0); write_cmd(g, ST7565_COLUMN_LSB | 0);
write_cmd(g, ST7565_RMW); write_cmd(g, ST7565_RMW);
flush_cmd(g);
enter_data_mode(g);
write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH);
enter_cmd_mode(g);
} }
unsigned line = (PRIV(g)->buffer2 ? 32 : 0); unsigned line = (PRIV(g)->buffer2 ? 32 : 0);
write_cmd(g, ST7565_START_LINE | line); write_cmd(g, ST7565_START_LINE | line);
flush_cmd(g);
PRIV(g)->buffer2 = !PRIV(g)->buffer2; PRIV(g)->buffer2 = !PRIV(g)->buffer2;
release_bus(g); release_bus(g);
@ -231,6 +237,33 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
} }
#endif #endif
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
uint8_t* buffer = (uint8_t*)g->p.ptr;
int linelength = g->p.cx;
for (int i = 0; i < g->p.cy; i++) {
unsigned dstx = g->p.x;
unsigned dsty = g->p.y + i;
unsigned srcx = g->p.x1;
unsigned srcy = g->p.y1 + i;
unsigned srcbit = srcy * g->p.x2 + srcx;
for(int j=0; j < linelength; j++) {
uint8_t src = buffer[srcbit / 8];
uint8_t bit = 7-(srcbit % 8);
uint8_t bitset = (src >> bit) & 1;
uint8_t* dst = &(RAM(g)[xyaddr(dstx, dsty)]);
if (bitset) {
*dst |= xybit(dsty);
}
else {
*dst &= ~xybit(dsty);
}
dstx++;
srcbit++;
}
}
g->flags |= GDISP_FLG_NEEDFLUSH;
}
#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
LLDSPEC void gdisp_lld_control(GDisplay *g) { LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) { switch(g->p.x) {
@ -242,12 +275,16 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
case powerSleep: case powerSleep:
case powerDeepSleep: case powerDeepSleep:
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
write_cmd(g, ST7565_DISPLAY_OFF); write_cmd(g, ST7565_DISPLAY_OFF);
flush_cmd(g);
release_bus(g); release_bus(g);
break; break;
case powerOn: case powerOn:
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
write_cmd(g, ST7565_DISPLAY_ON); write_cmd(g, ST7565_DISPLAY_ON);
flush_cmd(g);
release_bus(g); release_bus(g);
break; break;
default: default:
@ -278,12 +315,12 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
return; return;
case GDISP_CONTROL_CONTRAST: case GDISP_CONTROL_CONTRAST:
if ((unsigned)g->p.ptr > 100) g->g.Contrast = (unsigned)g->p.ptr & 63;
g->p.ptr = (void *)100;
acquire_bus(g); acquire_bus(g);
write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); enter_cmd_mode(g);
write_cmd2(g, ST7565_CONTRAST, g->g.Contrast);
flush_cmd(g);
release_bus(g); release_bus(g);
g->g.Contrast = (unsigned)g->p.ptr;
return; return;
} }
} }

@ -18,6 +18,7 @@
#define GDISP_HARDWARE_DRAWPIXEL TRUE #define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE #define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE #define GDISP_HARDWARE_CONTROL TRUE
#define GDISP_HARDWARE_BITFILLS TRUE
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO #define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO

@ -34,4 +34,6 @@
#define ST7565_RESISTOR_RATIO 0x20 #define ST7565_RESISTOR_RATIO 0x20
#define ST7565_POWER_CONTROL 0x28 #define ST7565_POWER_CONTROL 0x28
#define ST7565_RESET 0xE2
#endif /* _ST7565_H */ #endif /* _ST7565_H */

@ -143,7 +143,7 @@
#define GDISP_HARDWARE_DRAWPIXEL TRUE #define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_CLEARS FALSE #define GDISP_HARDWARE_CLEARS FALSE
#define GDISP_HARDWARE_FILLS FALSE #define GDISP_HARDWARE_FILLS FALSE
#define GDISP_HARDWARE_BITFILLS FALSE //#define GDISP_HARDWARE_BITFILLS FALSE
#define GDISP_HARDWARE_SCROLL FALSE #define GDISP_HARDWARE_SCROLL FALSE
#define GDISP_HARDWARE_PIXELREAD TRUE #define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE #define GDISP_HARDWARE_CONTROL TRUE

@ -70,10 +70,33 @@ void lcd_backlight_hal_init(void) {
RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
} }
static uint16_t cie_lightness(uint16_t v) {
// The CIE 1931 formula for lightness
// Y = luminance (output) 0-1
// L = lightness input 0 - 100
// Y = (L* / 902.3) if L* <= 8
// Y = ((L* + 16) / 116)^3 if L* > 8
float l = 100.0f * (v / 65535.0f);
float y = 0.0f;
if (l <= 8.0f) {
y = l / 902.3;
}
else {
y = ((l + 16.0f) / 116.0f);
y = y * y * y;
if (y > 1.0f) {
y = 1.0f;
}
}
return y * 65535.0f;
}
void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
CHANNEL_RED.CnV = r; CHANNEL_RED.CnV = cie_lightness(r);
CHANNEL_GREEN.CnV = g; CHANNEL_GREEN.CnV = cie_lightness(g);
CHANNEL_BLUE.CnV = b; CHANNEL_BLUE.CnV = cie_lightness(b);
} }
__attribute__ ((weak)) __attribute__ ((weak))
@ -103,34 +126,48 @@ void matrix_scan_kb(void) {
matrix_scan_user(); matrix_scan_user();
} }
__attribute__ ((weak))
void ergodox_board_led_on(void){ void ergodox_board_led_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_1_on(void){ void ergodox_right_led_1_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_2_on(void){ void ergodox_right_led_2_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_3_on(void){ void ergodox_right_led_3_on(void){
} }
void ergodox_right_led_on(uint8_t led){ __attribute__ ((weak))
}
void ergodox_board_led_off(void){ void ergodox_board_led_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_1_off(void){ void ergodox_right_led_1_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_2_off(void){ void ergodox_right_led_2_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_3_off(void){ void ergodox_right_led_3_off(void){
} }
void ergodox_right_led_off(uint8_t led){ __attribute__ ((weak))
void ergodox_right_led_1_set(uint8_t n) {
}
__attribute__ ((weak))
void ergodox_right_led_2_set(uint8_t n) {
}
__attribute__ ((weak))
void ergodox_right_led_3_set(uint8_t n) {
} }
#ifdef ONEHAND_ENABLE #ifdef ONEHAND_ENABLE

@ -7,13 +7,38 @@ void ergodox_board_led_on(void);
void ergodox_right_led_1_on(void); void ergodox_right_led_1_on(void);
void ergodox_right_led_2_on(void); void ergodox_right_led_2_on(void);
void ergodox_right_led_3_on(void); void ergodox_right_led_3_on(void);
void ergodox_right_led_on(uint8_t led);
inline void ergodox_right_led_on(uint8_t led) {
switch (led) {
case 0:
ergodox_right_led_1_on();
break;
case 1:
ergodox_right_led_2_on();
break;
case 2:
ergodox_right_led_3_on();
break;
}
}
void ergodox_board_led_off(void); void ergodox_board_led_off(void);
void ergodox_right_led_1_off(void); void ergodox_right_led_1_off(void);
void ergodox_right_led_2_off(void); void ergodox_right_led_2_off(void);
void ergodox_right_led_3_off(void); void ergodox_right_led_3_off(void);
void ergodox_right_led_off(uint8_t led); inline void ergodox_right_led_off(uint8_t led) {
switch (led) {
case 0:
ergodox_right_led_1_off();
break;
case 1:
ergodox_right_led_2_off();
break;
case 2:
ergodox_right_led_3_off();
break;
}
}
inline void ergodox_led_all_on(void) inline void ergodox_led_all_on(void)
{ {
@ -31,35 +56,21 @@ inline void ergodox_led_all_off(void)
ergodox_right_led_3_off(); ergodox_right_led_3_off();
} }
inline void ergodox_right_led_1_set(uint8_t n){ void ergodox_right_led_1_set(uint8_t n);
if (n) { void ergodox_right_led_2_set(uint8_t n);
ergodox_right_led_1_on(); void ergodox_right_led_3_set(uint8_t n);
} else {
ergodox_right_led_1_off();
}
}
inline void ergodox_right_led_2_set(uint8_t n){
if (n) {
ergodox_right_led_2_on();
} else {
ergodox_right_led_2_off();
}
}
inline void ergodox_right_led_3_set(uint8_t n){
if (n) {
ergodox_right_led_3_on();
} else {
ergodox_right_led_3_off();
}
}
inline void ergodox_right_led_set(uint8_t led, uint8_t n){ inline void ergodox_right_led_set(uint8_t led, uint8_t n){
if (n) { switch (led) {
ergodox_right_led_on(led); case 0:
} else { ergodox_right_led_1_set(n);
ergodox_right_led_off(led); break;
case 1:
ergodox_right_led_2_set(n);
break;
case 2:
ergodox_right_led_3_set(n);
break;
} }
} }

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
#include "matrix.h" #include "matrix.h"
#include "serial_link/system/serial_link.h"
/* /*

@ -1,6 +1,7 @@
# project specific files # project specific files
SRC = matrix.c \ SRC = matrix.c \
led.c led.c \
animations.c
## chip/board settings ## chip/board settings
# - the next two should match the directories in # - the next two should match the directories in
@ -59,17 +60,13 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
# #
CUSTOM_MATRIX ?= yes # Custom matrix file CUSTOM_MATRIX ?= yes # Custom matrix file
SERIAL_LINK_ENABLE = yes SERIAL_LINK_ENABLE = yes
VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile VISUALIZER_ENABLE ?= yes
LCD_ENABLE ?= yes LCD_ENABLE ?= yes
LED_ENABLE ?= yes LED_ENABLE ?= no
LCD_BACKLIGHT_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes
MIDI_ENABLE = no MIDI_ENABLE = no
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
ifndef QUANTUM_DIR
include ../../../Makefile
endif
ifdef LCD_ENABLE ifdef LCD_ENABLE
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
endif endif

@ -0,0 +1,123 @@
/* Copyright 2017 Fred Sundvik
*
* 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 KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_
#define KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_
// Currently we are assuming that both the backlight and LCD are enabled
// But it's entirely possible to write a custom visualizer that use only
// one of them
#ifndef LCD_BACKLIGHT_ENABLE
#error This visualizer needs that LCD backlight is enabled
#endif
#ifndef LCD_ENABLE
#error This visualizer needs that LCD is enabled
#endif
#include "visualizer.h"
#include "visualizer_keyframes.h"
#include "lcd_keyframes.h"
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
#include "led.h"
#include "animations.h"
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
static bool initial_update = true;
// Feel free to modify the animations below, or even add new ones if needed
static keyframe_animation_t lcd_layer_display = {
.num_frames = 1,
.loop = false,
.frame_lengths = {gfxMillisecondsToTicks(0)},
.frame_functions = {lcd_keyframe_display_layer_and_led_states}
};
// The color animation animates the LCD color when you change layers
static keyframe_animation_t color_animation = {
.num_frames = 2,
.loop = false,
// Note that there's a 200 ms no-operation frame,
// this prevents the color from changing when activating the layer
// momentarily
.frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)},
.frame_functions = {keyframe_no_operation, backlight_keyframe_animate_color},
};
void initialize_user_visualizer(visualizer_state_t* state) {
// The brightness will be dynamically adjustable in the future
// But for now, change it here.
lcd_backlight_brightness(130);
state->current_lcd_color = initial_color;
state->target_lcd_color = logo_background_color;
initial_update = true;
start_keyframe_animation(&default_startup_animation);
}
// This function should be implemented by the keymap visualizer
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
// that the simple_visualizer assumes that you are updating
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
// stopped. This can be done by either double buffering it or by using constant strings
static void get_visualizer_layer_and_color(visualizer_state_t* state);
void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
// Add more tests, change the colors and layer texts here
// Usually you want to check the high bits (higher layers first)
// because that's the order layers are processed for keypresses
// You can for check for example:
// state->status.layer
// state->status.default_layer
// state->status.leds (see led.h for available statuses)
uint32_t prev_color = state->target_lcd_color;
const char* prev_layer_text = state->layer_text;
get_visualizer_layer_and_color(state);
if (initial_update || prev_color != state->target_lcd_color) {
start_keyframe_animation(&color_animation);
}
if (initial_update || prev_layer_text != state->layer_text) {
start_keyframe_animation(&lcd_layer_display);
}
// You can also stop existing animations, and start your custom ones here
// remember that you should normally have only one animation for the LCD
// and one for the background. But you can also combine them if you want.
}
void user_visualizer_suspend(visualizer_state_t* state) {
state->layer_text = "Suspending...";
uint8_t hue = LCD_HUE(state->current_lcd_color);
uint8_t sat = LCD_SAT(state->current_lcd_color);
state->target_lcd_color = LCD_COLOR(hue, sat, 0);
start_keyframe_animation(&default_suspend_animation);
}
void user_visualizer_resume(visualizer_state_t* state) {
state->current_lcd_color = initial_color;
state->target_lcd_color = logo_background_color;
initial_update = true;
start_keyframe_animation(&default_startup_animation);
}
#endif /* KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_ */

@ -0,0 +1,329 @@
/*
Copyright 2016 Fred Sundvik <fsundvik@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/>.
*/
// Currently we are assuming that both the backlight and LCD are enabled
// But it's entirely possible to write a custom visualizer that use only
// one of them
#ifndef LCD_BACKLIGHT_ENABLE
#error This visualizer needs that LCD backlight is enabled
#endif
#ifndef LCD_ENABLE
#error This visualizer needs that LCD is enabled
#endif
#include "visualizer.h"
#include "visualizer_keyframes.h"
#include "lcd_keyframes.h"
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
#include "animations.h"
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
static const uint32_t led_emulation_colors[4] = {
LCD_COLOR(0, 0, 0),
LCD_COLOR(255, 255, 255),
LCD_COLOR(84, 255, 255),
LCD_COLOR(168, 255, 255),
};
static uint32_t next_led_target_color = 0;
typedef enum {
LCD_STATE_INITIAL,
LCD_STATE_LAYER_BITMAP,
LCD_STATE_BITMAP_AND_LEDS,
} lcd_state_t;
static lcd_state_t lcd_state = LCD_STATE_INITIAL;
typedef struct {
uint8_t led_on;
uint8_t led1;
uint8_t led2;
uint8_t led3;
} visualizer_user_data_t;
// Don't access from visualization function, use the visualizer state instead
static visualizer_user_data_t user_data_keyboard = {
.led_on = 0,
.led1 = LED_BRIGHTNESS_HI,
.led2 = LED_BRIGHTNESS_HI,
.led3 = LED_BRIGHTNESS_HI,
};
_Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
"Please increase the VISUALIZER_USER_DATA_SIZE");
// Feel free to modify the animations below, or even add new ones if needed
// The color animation animates the LCD color when you change layers
static keyframe_animation_t one_led_color = {
.num_frames = 1,
.loop = false,
.frame_lengths = {gfxMillisecondsToTicks(0)},
.frame_functions = {backlight_keyframe_set_color},
};
bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
uint32_t temp = next_led_target_color;
next_led_target_color = state->target_lcd_color;
state->target_lcd_color = temp;
return false;
}
// The color animation animates the LCD color when you change layers
static keyframe_animation_t two_led_colors = {
.num_frames = 2,
.loop = true,
.frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
.frame_functions = {backlight_keyframe_set_color, swap_led_target_color},
};
// The LCD animation alternates between the layer name display and a
// bitmap that displays all active layers
static keyframe_animation_t lcd_bitmap_animation = {
.num_frames = 1,
.loop = false,
.frame_lengths = {gfxMillisecondsToTicks(0)},
.frame_functions = {lcd_keyframe_display_layer_bitmap},
};
static keyframe_animation_t lcd_bitmap_leds_animation = {
.num_frames = 2,
.loop = true,
.frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)},
.frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states},
};
void initialize_user_visualizer(visualizer_state_t* state) {
// The brightness will be dynamically adjustable in the future
// But for now, change it here.
lcd_backlight_brightness(130);
state->current_lcd_color = initial_color;
state->target_lcd_color = logo_background_color;
lcd_state = LCD_STATE_INITIAL;
start_keyframe_animation(&default_startup_animation);
}
inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) {
return user_data->led_on & (1u << num);
}
static uint8_t get_led_index_master(visualizer_user_data_t* user_data) {
for (int i=0; i < 3; i++) {
if (is_led_on(user_data, i)) {
return i + 1;
}
}
return 0;
}
static uint8_t get_led_index_slave(visualizer_user_data_t* user_data) {
uint8_t master_index = get_led_index_master(user_data);
if (master_index!=0) {
for (int i=master_index; i < 3; i++) {
if (is_led_on(user_data, i)) {
return i + 1;
}
}
}
return 0;
}
static uint8_t get_secondary_led_index(visualizer_user_data_t* user_data) {
if (is_led_on(user_data, 0) &&
is_led_on(user_data, 1) &&
is_led_on(user_data, 2)) {
return 3;
}
return 0;
}
static uint8_t get_brightness(visualizer_user_data_t* user_data, uint8_t index) {
switch (index) {
case 1:
return user_data->led1;
case 2:
return user_data->led2;
case 3:
return user_data->led3;
}
return 0;
}
static void update_emulated_leds(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
visualizer_user_data_t* user_data_new = (visualizer_user_data_t*)state->status.user_data;
visualizer_user_data_t* user_data_old = (visualizer_user_data_t*)prev_status->user_data;
uint8_t new_index;
uint8_t old_index;
if (is_serial_link_master()) {
new_index = get_led_index_master(user_data_new);
old_index = get_led_index_master(user_data_old);
}
else {
new_index = get_led_index_slave(user_data_new);
old_index = get_led_index_slave(user_data_old);
}
uint8_t new_secondary_index = get_secondary_led_index(user_data_new);
uint8_t old_secondary_index = get_secondary_led_index(user_data_old);
uint8_t old_brightness = get_brightness(user_data_old, old_index);
uint8_t new_brightness = get_brightness(user_data_new, new_index);
uint8_t old_secondary_brightness = get_brightness(user_data_old, old_secondary_index);
uint8_t new_secondary_brightness = get_brightness(user_data_new, new_secondary_index);
if (lcd_state == LCD_STATE_INITIAL ||
new_index != old_index ||
new_secondary_index != old_secondary_index ||
new_brightness != old_brightness ||
new_secondary_brightness != old_secondary_brightness) {
if (new_secondary_index != 0) {
state->target_lcd_color = change_lcd_color_intensity(
led_emulation_colors[new_index], new_brightness);
next_led_target_color = change_lcd_color_intensity(
led_emulation_colors[new_secondary_index], new_secondary_brightness);
stop_keyframe_animation(&one_led_color);
start_keyframe_animation(&two_led_colors);
} else {
state->target_lcd_color = change_lcd_color_intensity(
led_emulation_colors[new_index], new_brightness);
stop_keyframe_animation(&two_led_colors);
start_keyframe_animation(&one_led_color);
}
}
}
static void update_lcd_text(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
if (state->status.leds) {
if (lcd_state != LCD_STATE_BITMAP_AND_LEDS ||
state->status.leds != prev_status->leds ||
state->status.layer != prev_status->layer ||
state->status.default_layer != prev_status->default_layer) {
// NOTE: that it doesn't matter if the animation isn't playing, stop will do nothing in that case
stop_keyframe_animation(&lcd_bitmap_animation);
lcd_state = LCD_STATE_BITMAP_AND_LEDS;
// For information:
// The logic in this function makes sure that this doesn't happen, but if you call start on an
// animation that is already playing it will be restarted.
start_keyframe_animation(&lcd_bitmap_leds_animation);
}
} else {
if (lcd_state != LCD_STATE_LAYER_BITMAP ||
state->status.layer != prev_status->layer ||
state->status.default_layer != prev_status->default_layer) {
stop_keyframe_animation(&lcd_bitmap_leds_animation);
lcd_state = LCD_STATE_LAYER_BITMAP;
start_keyframe_animation(&lcd_bitmap_animation);
}
}
}
void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
// Check the status here to start and stop animations
// You might have to save some state, like the current animation here so that you can start the right
// This function is called every time the status changes
// NOTE that this is called from the visualizer thread, so don't access anything else outside the status
// This is also important because the slave won't have access to the active layer for example outside the
// status.
update_emulated_leds(state, prev_status);
update_lcd_text(state, prev_status);
}
void user_visualizer_suspend(visualizer_state_t* state) {
state->layer_text = "Suspending...";
uint8_t hue = LCD_HUE(state->current_lcd_color);
uint8_t sat = LCD_SAT(state->current_lcd_color);
state->target_lcd_color = LCD_COLOR(hue, sat, 0);
start_keyframe_animation(&default_suspend_animation);
}
void user_visualizer_resume(visualizer_state_t* state) {
state->current_lcd_color = initial_color;
state->target_lcd_color = logo_background_color;
lcd_state = LCD_STATE_INITIAL;
start_keyframe_animation(&default_startup_animation);
}
void ergodox_board_led_on(void){
// No board led support
}
void ergodox_right_led_1_on(void){
user_data_keyboard.led_on |= (1u << 0);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_2_on(void){
user_data_keyboard.led_on |= (1u << 1);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_3_on(void){
user_data_keyboard.led_on |= (1u << 2);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_board_led_off(void){
// No board led support
}
void ergodox_right_led_1_off(void){
user_data_keyboard.led_on &= ~(1u << 0);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_2_off(void){
user_data_keyboard.led_on &= ~(1u << 1);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_3_off(void){
user_data_keyboard.led_on &= ~(1u << 2);
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_1_set(uint8_t n) {
user_data_keyboard.led1 = n;
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_2_set(uint8_t n) {
user_data_keyboard.led2 = n;
visualizer_set_user_data(&user_data_keyboard);
}
void ergodox_right_led_3_set(uint8_t n) {
user_data_keyboard.led3 = n;
visualizer_set_user_data(&user_data_keyboard);
}

@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* TL2 TL3 * TL2 TL3
* LSHFT Ü Ö Ä P Z B M , . J Shift * LSHFT Ü Ö Ä P Z B M , . J Shift
* *
* CTL ALT MO1 Win Mod4 Mod4 Win MO1 Alt CTL * CTL ALT MO1 Win Mod4 Mod4 Win MO1 ALT CTL
* *
* *
* *
@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS,
NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R,
TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT,
NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, NEO_L2_R,KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* (TL2) (TL3) * (TL2) (TL3)
* LSHFT Ä Q R W N J M , . Shift * LSHFT Ä Q R W N J M , . Shift
* *
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL * CTL ALT MO1 Win MO4 M04 Win MO1 ALT CTL
* *
* *
* *
@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y,
DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R,
KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* (TL2) (TL3) * (TL2) (TL3)
* LSHFT Ü Ö Ä P Z B M , . J Shift * LSHFT Ü Ö Ä P Z B M , . J Shift
* *
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL * CTL ALT MO1 Win MO4 M04 Win MO1 ALT CTL
* *
* *
* *
@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS,
DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO,
KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -135,13 +135,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 3: F-keys, Mouse and Unicode /* Layer 3: F-keys, Mouse and Unicode
* *
* * F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
* *
* F9 F10 F11 F12 *
* *
* F5 F6 F7 F8 *
* (TL2) (TL3) * (TL2) (TL3)
* F1 F2 F3 F4 *
* *
* (MO1) (MO4) (MO4) (MO1) * (MO1) (MO4) (MO4) (MO1)
* *
@ -154,19 +154,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[FMU] = KEYMAP( [FMU] = KEYMAP(
// left hand // left hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS, KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS,
KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x2713),UC(0x2715), KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x3008),UC(0x3009),
KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),UC(0x2194),UC(0x21D4),KC_TRNS, KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),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_MS_L, KC_MS_U, KC_MS_L, KC_MS_U,
KC_BTN1, KC_BTN1,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
// right hand // right hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, UC(0x2194),UC(0x2190),UC(0x2192),UC(0x2191),UC(0x2193),KC_TRNS,
KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, KC_TRNS, UC(0x2713),UC(0x2715),UC(0x2022),UC(0x2236),KC_TRNS,
KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS, UC(0x21D4),UC(0x21D0),UC(0x21D2),UC(0x21D1),UC(0x21D3),KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_MS_D, KC_MS_R, KC_MS_D, KC_MS_R,
KC_BTN2, KC_BTN2,
@ -296,9 +296,8 @@ uint16_t hex_to_keycode(uint8_t hex)
{ {
if(hex == 0x0) { if(hex == 0x0) {
return KC_0; return KC_0;
} else if (hex < 0xA) { }
return KC_1 + (hex - 0x1); else if(hex >= 0xA) {
} else {
switch(hex) { switch(hex) {
case 0xA: case 0xA:
return NEO_A; return NEO_A;
@ -316,4 +315,6 @@ uint16_t hex_to_keycode(uint8_t hex)
return KC_NO; return KC_NO;
} }
} }
return KC_1 + (hex - 0x1);
} }

@ -4,10 +4,18 @@ The idea of this layout is to use it for [Neo2](http://www.neo-layout.org) but a
The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course). The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course).
It also features a layer for additional keys like F-keys (F1 F12), some mouse keys and (hopefully in the near future) some useful Unicode symbols. It also features a layer for additional keys like F-keys (F1 F12), some mouse keys and some useful Unicode symbols.
## Layers ## Build
```
make clean
make coderkun_neo2
```
## Keymap
0. Default layer for Neo2 0. Default layer for Neo2
1. Poor mans QWERTZ 1. Poor mans QWERTZ
@ -16,16 +24,106 @@ It also features a layer for additional keys like F-keys (F1 F12), some mous
4. Neos software layers 4 rebuilt in hardware 4. Neos software layers 4 rebuilt in hardware
## Build ### Layer 0: Default layer for Neo2
1. Enable Unicode in Makefile ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
```
UNICODE_ENABLE = yes
```
2. Build as usual
``` ### Layer 1: Poor mans QWERTZ
make clean
make KEYMAP=coderkun_neo2 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
``` │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 2: Poor mans Neo
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 3: F-keys, mouse keys und Unicode symbols
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ ↔ │ ← │ → │ ↑ │ ↓ │ │
├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ │ │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇐ │ ⇒ │ ⇑ │ ⇓ │ │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ Ms← │ Ms↑ │ │ Ms↓ │ Ms→ │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ MLC │ │ MRC │ │ │
│ │ ├─────┤ ├─────┤ │ │
│ │ │ │ │ │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 4: Neos software layers 4 rebuilt in hardware
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │
├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ │ Home│ ← │ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ │ │ │ │ │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ │ │ │ │ │
│ │ ├─────┤ ├─────┤ │ │
│ │ │ │ │ │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘

@ -0,0 +1,42 @@
/*
Copyright 2017 Fred Sundvik
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 "simple_visualizer.h"
// This function should be implemented by the keymap visualizer
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
// that the simple_visualizer assumes that you are updating
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
// stopped. This can be done by either double buffering it or by using constant strings
static void get_visualizer_layer_and_color(visualizer_state_t* state) {
uint8_t saturation = 60;
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
saturation = 255;
}
if (state->status.layer & 0x4) {
state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF);
state->layer_text = "Media & Mouse";
}
else if (state->status.layer & 0x2) {
state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF);
state->layer_text = "Symbol";
}
else {
state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF);
state->layer_text = "Default";
}
}

@ -311,12 +311,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break; break;
case SWITCH_NDS: case SWITCH_NDS:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(F11), U(LSFT), W(500), D(LALT), T(TAB), U(LALT), END); return MACRO( D(LSFT), T(F11), U(LSFT), W(255), D(LALT), T(TAB), U(LALT), END);
} }
break; break;
case OPEN_CLOSE_PAREN: case OPEN_CLOSE_PAREN:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(LPRN), T(RPRN), U(LSFT), T(LEFT), END); return MACRO( D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END);
} }
break; break;
case OPEN_CLOSE_BRACKET: case OPEN_CLOSE_BRACKET:
@ -326,7 +326,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break; break;
case OPEN_CLOSE_CURLY: case OPEN_CLOSE_CURLY:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(LCBR), T(RCBR), U(LSFT), T(LEFT), END); return MACRO( D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END);
} }
break; break;
case OPEN_CLOSE_SINGLE_QUOTE: case OPEN_CLOSE_SINGLE_QUOTE:

@ -0,0 +1,331 @@
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_nordic.h"
#include "keymap_norwegian.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // mouse keys
#define DEVL 3 // dev keys
#define MACRO_PUBLIC 10
#define MACRO_PRIVATE 11
#define MACRO_PROT 12
#define MACRO_SHARED 13
#define MACRO_CONST 14
#define MACRO_DIM 15
#define MACRO_STRING 16
#define MACRO_INT 17
#define MACRO_DEC 18
#define MACRO_BOOL 19
#define MACRO_RETURN 20
#define MACRO_NOTHING 21
#define MACRO_TODO 22
#define MACRO_SAVE 24
#define MACRO_BUILD 25
#define MACRO_DEBUG 26
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | L3 | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Del | - | , | . | P | Y | LT1 | | LT1 | F | G | C | R | L | Å |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | WIN | A | O | E | U | I |------| |------| D | H | T | N | S | Ä |
* |--------+------+------+------+------+------| LT2 | | LT2 |------+------+------+------+------+--------|
* | LShift | Ö | Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | CTRL | L1 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | LGui | | Alt |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Space|Backsp|------| |------| Tab |Enter |
* | |ace | End | | PgDn | | |
* `--------------------' `----------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[BASE] = KEYMAP( // layer 0 : default
// left hand
MO(DEVL), KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_DELT, NO_MINS, KC_COMM, KC_DOT, KC_P, KC_Y, TG(SYMB),
KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I,
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(MDIA),
CTL_T(KC_NO), MO(SYMB), LALT(KC_LSFT), KC_LEFT,KC_RGHT,
ALT_T(KC_APP), KC_LGUI,
KC_HOME,
KC_SPC,KC_BSPC,KC_END,
// right hand
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLASH,
TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, NO_AM,
KC_D, KC_H, KC_T, KC_N, KC_S, NO_AE,
TG(MDIA),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN,KC_TAB, KC_ENT
),
/* Keymap 1: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | @ | { | } | [ | ] | | | | < | 7 | 8 | 9 | * | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | ( | ) | \ | / |------| |------| > | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | UND | CUT | COP | PAS | | | | ? | 1 | 2 | 3 | % | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | . | 0 | = | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// SYMBOLS
[SYMB] = KEYMAP(
// left hand
M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
KC_TRNS, NO_AT, ALGR(KC_7), ALGR(KC_0), NO_LBRC, NO_RBRC, KC_TRNS,
KC_TRNS, KC_HASH, NO_LPRN, NO_RPRN, ALGR(KC_MINS), NO_SLSH,
KC_TRNS, KC_TRNS, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,KC_TRNS,
KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, NO_LESS, KC_7, KC_8, KC_9, KC_KP_ASTERISK, KC_F12,
LSFT(NO_LESS), KC_4, KC_5, KC_6, KC_KP_PLUS, KC_TRNS,
KC_TRNS, NO_QUES, KC_1, KC_2, KC_3, LSFT(KC_5), KC_TRNS,
KC_DOT,KC_0, LSFT(KC_0), KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
[MDIA] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
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
),
/* Keymap 3: Developer keys in vb.net
* shortened in layout beneth, for example int-> integer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | Save |Build |Debug | | | | | | bool | int |string| dec | Todo | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| priv | publ |shared| prot | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | const| dim |return|nothin| | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
[DEVL] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(MACRO_SAVE), M(MACRO_BUILD), M(MACRO_DEBUG), 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,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(MACRO_BOOL), M(MACRO_INT), M(MACRO_STRING), M(MACRO_DEC), M(MACRO_TODO), KC_TRNS,
M(MACRO_PRIVATE), M(MACRO_PUBLIC), M(MACRO_SHARED), M(MACRO_PROT), KC_TRNS, KC_TRNS,
KC_TRNS, M(MACRO_CONST), M(MACRO_DIM), M(MACRO_RETURN), M(MACRO_NOTHING), 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[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
};
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;
case MACRO_PUBLIC:
if (record->event.pressed) {
return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END);
}
break;
case MACRO_PRIVATE:
if (record->event.pressed) {
return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END);
}
break;
case MACRO_PROT:
if (record->event.pressed) {
return MACRO( T(P), T(R), T(O), T(T), T(E), T(C), T(T), T(E), T(D), T(SPACE),END);
}
break;
case MACRO_SHARED:
if (record->event.pressed) {
return MACRO( T(S), T(H), T(A), T(R), T(E), T(D), T(SPACE), END);
}
break;
case MACRO_CONST:
if (record->event.pressed) {
return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END);
}
break;
case MACRO_DIM:
if (record->event.pressed) {
return MACRO( T(D), T(I), T(M), T(SPACE), END);
}
break;
case MACRO_STRING:
if (record->event.pressed) {
return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END);
}
break;
case MACRO_BOOL:
if (record->event.pressed) {
return MACRO( T(B), T(O), T(O), T(L), T(E), T(A), T(N), T(SPACE), END);
}
break;
case MACRO_INT:
if (record->event.pressed) {
return MACRO( T(I), T(N), T(T), T(SPACE), END);
}
break;
case MACRO_DEC:
if (record->event.pressed) {
return MACRO( T(D), T(E), T(C), T(I), T(M), T(A), T(L), T(SPACE), END);
}
break;
case MACRO_RETURN:
if (record->event.pressed) {
return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), T(SPACE), END);
}
break;
case MACRO_NOTHING:
if (record->event.pressed) {
return MACRO( T(N), T(O), T(T), T(H), T(I), T(N), T(G), T(SPACE), END);
}
case MACRO_TODO:
if (record->event.pressed) {
return MACRO( KC_BSLASH, D(LSHIFT) ,T(T), T(O), T(D), T(O), KC_DOT, U(LSHIFT), T(SPACE),END);
}
break;
case MACRO_SAVE:
if (record->event.pressed) {
return MACRO( D(LCTL) ,T(S), U(LCTL),END);
}
break;
case MACRO_BUILD:
if (record->event.pressed) {
return MACRO( D(LCTL), D(LSHIFT) ,T(B), U(LSHIFT), U(LCTL),END);
}
break;
case MACRO_DEBUG:
if (record->event.pressed) {
return MACRO( KC_F5 ,END);
}
break;
}
return MACRO_NONE;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
default:
// none
break;
}
};

@ -0,0 +1,28 @@
# ErgoDox EZ Dvorak Programmer SWEDISH
Dvorak layout adjusted for a suitable programmer layout and swedish special characters added:
* åäö characters added
* Layout for common vb.net keywords
* Common Visual Studio commands like Save, Build, Debug
TODO:
* (Layer 4 is qwerty (for easier gaming & less fortunate keyboard users)) Like this idea, will add it later on
Known issues:
* Keymap 2 modifier has not gotten its place yet..
* Print screen, where?
## Changelog
* 2017-05-16
* Initial release
# Author
Christian Westerlund
cwesterlund @ github
Thanks to the author of keymap csharp_dev for inspiration!

@ -0,0 +1,69 @@
# ErgoDox Familiar Layout
Familiar layout for those who regularly switch back and forth from ErgoDox to regular QWERTY.
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](../../../../license_GPLv3.md../../../../license_GPLv3.md) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)
## Table of Contents
- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [Layers](#layers)
- [Contribute](#contribute)
- [Issues](#issues)
- [License](#license)
## Background
This layout is built to be as familiar as possible for users coming directly from a default (QWERTY US) keyboard, while gaining as much advantage as possible from the ErgoDox and QMK featureset. I use an ErgoDoxEZ at home, but I don't have a regular office (CS grad student) so I regularly use either my laptop or a default-setup lab computer; I context switch daily so this layout is meant to reduce the mental overhead as much as possible.
The default ErgoDoxEZ layout is probably more optimized as a solo daily driver - as are a lot of the others available keymaps. The focus of this layout is to get as much from the 'Dox as possible without overly disrupting long-established muscle memory.
Key features of the familiar layout:
1. QWERTY default layout.
1. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable).
1. Numpad layer on right hand.
1. Thumb cluster holds spacebar, ALT, and access to secondary layers.
1. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations.
## Install
If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 235).
```c
void matrix_init_user(void) {
set_unicode_input_mode(UC_LNX); // Linux
//set_unicode_input_mode(UC_OSX); // Mac OSX
//set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
//set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
};
```
For instructions on building and installing this keymap, [go to the wiki](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ergodox#build-dependencies). Below is the command for me; it may be different for you.
```sh
$ make ergodox-ez-familiar-teensy
```
## Usage
[![Familiar Layout](familiar.png)](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644)
### Layers
1. Base Layer: QWERTY, with arrow keys at bottom right.
1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster).
1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed through holding shift while the UCIS layer is active (toggles the `INSF` layer).
1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster).
1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions.
## Contribute
[Contributor Covenant](http://contributor-covenant.org/)
I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it.
### Issues
1. The top two keys of the right thumb cluster are currently unused. I wanted them for screen brightness, but I haven't found a solution I like.
1. The `'`, `"`, `[`, and `]` keys are terrible to access; I want to put them somewhere else but I haven't figured out where.
1. The `INSF` layer is an ugly workaround. I should write a function for doing different things in the `INTL` layer depending on whether SHIFT is being held. Or something. Ideas?
## License
QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](blob/master/license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md).

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

@ -0,0 +1,267 @@
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
// Layers
#define BASE 0 // default layer
#define INTL 1 // international symbols
#define INSF 2 // international symbols shifted
#define NUMP 3 // numpad
#define ARRW 4 // function, media, arrow keys
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
/* layer 0 : default
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | ` | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER |
* |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------|
* | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | VOL- | VOL+ | | | |
* ,------|------|------| |------+------+------.
* | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ |
* | ALT | MO(1)|------| |------|MO(1) | ALT |
* | | | LAY3 | | LAY2 | | |
* `--------------------' `--------------------'
*/
[BASE] = KEYMAP(
// left hand
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END,
KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, S(KC_QUOT),
KC_VOLD, KC_VOLU,
KC_MUTE,
ALT_T(KC_SPC), LT(ARRW,KC_SLSH), TG(INTL),
// right hand
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER,
KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC,
KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT,
_______, _______,
KC_NLCK,
TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC)
),
/* layer 1: International symbols, etc
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ´ | ¡ | ² | ³ | ¤ | | ¼ | | ½ | ¾ | | | ¥ | × | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | á | ß | ð | | |------| |------| | | | ø | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |MO(INSF)| æ | | © | | | | | | ñ | µ | ç | | |MO(INSF)|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | ¬ | ¿ | | « | » | | | |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[INTL] = KEYMAP(
// left hand
UC(0x00B4), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC),
_______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______,
_______, UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______,
MO(INSF), UC(0x00E6), _______, UC(0x00A9), _______, _______, _______,
_______, _______, _______, UC(0x00AC), UC(0x00BF),
_______, _______,
_______,
_______, _______, _______,
// right hand
UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______,
_______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______,
_______, _______, _______, UC(0x00F8), UC(0x00B6), _______,
_______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(INSF),
UC(0x00AB), UC(0x00BB), _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 2 : international symbols, shifted
* This layer is an ugly workaround; it pretends that SHIFT still works normally on keys
* which don't produce an "upper case" or "shifted" international symobol.
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ¨ | ¹ | | | £ | | | | | | | | | ÷ | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Á | § | Ð | | |------| |------| | | | Ø | ° | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Æ | | ¢ | | | | | | Ñ | | Ç | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | ¦ | | | | | | | |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[INSF] = KEYMAP(
// left hand
UC(0x00A8), UC(0x00B9), _______, _______, UC(0x00A3), _______, _______,
_______, UC(0x00C4), UC(0x00C5), UC(0x00C9), _______, UC(0x00DE), _______,
_______, UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G),
_______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______,
_______, _______, _______, UC(0x00A6), _______,
_______, _______,
_______,
_______, _______, _______,
// right hand
_______, _______, _______, _______, UC(0x2014), UC(0x00F7), _______,
_______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______,
S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______,
_______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 3: numberpad
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | ( | ) | / | * | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | 7 | 8 | 9 | - | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | 1 | 2 | 3 | = | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | 0 | . | , | ENTER| |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[NUMP] = KEYMAP(
// left hand
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______,
// right hand
_______, _______, S(KC_9), S(KC_0), KC_PSLS, KC_PAST, _______,
_______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
_______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
_______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______,
KC_KP_0, KC_KP_DOT, KC_PCMM, KC_PENT, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 4 : functions and arrows
* This layer is at the top so that the functions still work no matter what layers are active.
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | SYSREQ |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | UP | | | | | | | | | | | INSERT |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |CAPSLOCK| | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | HOME | PGDN | END |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | PAUSE| | | |
* ,------|------|------| |------+------+------.
* | | | | |SCRLK | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[ARRW] = KEYMAP(
// left hand
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
_______, _______, _______, KC_UP, _______, _______, _______,
KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, KC_PAUSE,
_______,
_______, _______, _______,
// right hand
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SYSREQ,
_______, _______, _______, _______, _______, _______, KC_INS,
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
_______, _______, _______, _______, _______, KC_PGUP, _______,
_______, _______, KC_HOME, KC_PGDN, KC_END,
_______, _______,
KC_SLCK,
_______, _______, _______
),
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
set_unicode_input_mode(UC_LNX); // Linux
//set_unicode_input_mode(UC_OSX); // Mac OSX
//set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
//set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
case INTL:
case INSF:
ergodox_right_led_1_on();
break;
case NUMP:
ergodox_right_led_2_on();
break;
case ARRW:
ergodox_right_led_3_on();
break;
default:
// none
break;
}
};

@ -392,7 +392,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case NotEq: case NotEq:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( I(10), D(LSFT), T(EXLM), U(LSFT), T(EQL), END ); // != return MACRO( I(10), D(LSFT), T(1), U(LSFT), T(EQL), END ); // !=
} }
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

@ -0,0 +1,187 @@
// Netable differences vs. the default firmware for the ErgoDox EZ:
// 1. The Cmd key is now on the right side, making Cmd+Space easier.
// 2. The media keys work on OSX (But not on Windows).
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | LCtl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui |
* |--------+------+------+------+------+------| BkSp | | Meh |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,---------------.
* | BkSp | LGui | | Alt |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Space|LANG1 |------| |------|LANG2 |Enter |
* | /LGui| | End | | PgDn | | |
* `--------------------' `----------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[BASE] = KEYMAP( // layer 0 : default
// left hand
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_BSPC,
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
KC_BSPC, KC_LGUI,
KC_HOME,
MT(MOD_LGUI, KC_SPC),KC_LANG1,KC_END,
// right hand
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI,
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN,KC_LANG2, KC_ENT
),
/* Keymap 1: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | . | 0 | = | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// SYMBOLS
[SYMB] = KEYMAP(
// left hand
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,
KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | MsUp | | | | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | Prev | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | |Brwser|
* | | |------| |------| |Back |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// MEDIA AND MOUSE
[MDIA] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
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_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_WBAK
),
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
};
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;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
default:
// none
break;
}
};

@ -0,0 +1,15 @@
# ErgoDox EZ Default Configuration
## Changelog
* Dec 2016:
* Added LED keys
* Refreshed layout graphic, comes from http://configure.ergodox-ez.com now.
* Sep 22, 2016:
* Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
* Feb 2, 2016 (V1.1):
* Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
This is what we ship with out of the factory. :) The image says it all:
![Default](default_firmware_v1.2-2.png)

@ -254,7 +254,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -265,17 +265,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _DV: case _DV:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DV);
} }
break; break;
case _QW: case _QW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_QW);
} }
break; break;
case _CM: case _CM:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); persistent_default_layer_set(1UL<<_CM);
} }
break; break;
} }

@ -17,7 +17,7 @@
#include "yoruian.h" #include "yoruian.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP\ [0] = KEYMAP_YORUIAN\
(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8, (9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8,
ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q, ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q,
LC, U, I, A, N, SCLN, M, H, T, S, C, RC, LC, U, I, A, N, SCLN, M, H, T, S, C, RC,
@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
BSPC, RALT, P2, TAB, BSPC, RALT, P2, TAB,
NO, NO, NO, NO,
E, LSFT, NO, NO, ENT, SPC), E, LSFT, NO, NO, ENT, SPC),
[1] = KEYMAP\ [1] = KEYMAP_YORUIAN\
(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9, (TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9,
TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT, TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT,
TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE, TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE,

@ -18,9 +18,7 @@
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#undef KEYMAP #define KEYMAP_YORUIAN( \
#define KEYMAP\
( \
/* Spacial positions. */ \ /* Spacial positions. */ \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ 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, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
@ -30,24 +28,22 @@
k55, k56, k57, k58, \ k55, k56, k57, k58, \
k54, k59, \ k54, k59, \
k53, k52, k51, k5C, k5B, k5A) \ k53, k52, k51, k5C, k5B, k5A) \
\ KEYMAP(KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, \
/* Matrix positions. */ \ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, \
{ \ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, \
{ KC_##k00, KC_##k10, KC_##k20, KC_##k30, KC_##k40, KC_NO }, \ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, \
{ KC_##k01, KC_##k11, KC_##k21, KC_##k31, KC_##k41, KC_##k51 }, \ KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, \
{ KC_##k02, KC_##k12, KC_##k22, KC_##k32, KC_##k42, KC_##k52 }, \ KC_##k55, KC_##k56, \
{ KC_##k03, KC_##k13, KC_##k23, KC_##k33, KC_##k43, KC_##k53 }, \ KC_##k54, \
{ KC_##k04, KC_##k14, KC_##k24, KC_##k34, KC_##k44, KC_##k54 }, \ KC_##k53, KC_##k52, KC_##k51, \
{ KC_##k05, KC_##k15, KC_##k25, KC_##k35, KC_NO, KC_##k55 }, \ KC_##k07, KC_##k08, KC_##k09, KC_##k0A, KC_##k0B, KC_##k0C, KC_##k0D, \
{ KC_##k06, KC_##k16, KC_NO, KC_##k36, KC_NO, KC_##k56 }, \ KC_##k17, KC_##k18, KC_##k19, KC_##k1A, KC_##k1B, KC_##k1C, KC_##k1D, \
{ KC_##k07, KC_##k17, KC_NO, KC_##k37, KC_NO, KC_##k57 }, \ KC_##k28, KC_##k29, KC_##k2A, KC_##k2B, KC_##k2C, KC_##k2D, \
{ KC_##k08, KC_##k18, KC_##k28, KC_##k38, KC_NO, KC_##k58 }, \ KC_##k37, KC_##k38, KC_##k39, KC_##k3A, KC_##k3B, KC_##k3C, KC_##k3D, \
{ KC_##k09, KC_##k19, KC_##k29, KC_##k39, KC_##k49, KC_##k59 }, \ KC_##k49, KC_##k4A, KC_##k4B, KC_##k4C, KC_##k4D, \
{ KC_##k0A, KC_##k1A, KC_##k2A, KC_##k3A, KC_##k4A, KC_##k5A }, \ KC_##k57, KC_##k58, \
{ KC_##k0B, KC_##k1B, KC_##k2B, KC_##k3B, KC_##k4B, KC_##k5B }, \ KC_##k59, \
{ KC_##k0C, KC_##k1C, KC_##k2C, KC_##k3C, KC_##k4C, KC_##k5C }, \ KC_##k5C, KC_##k5B, KC_##k5A)
{ KC_##k0D, KC_##k1D, KC_##k2D, KC_##k3D, KC_##k4D, KC_NO } \
}
#define KC_ES KC_ESC #define KC_ES KC_ESC
#define KC_LC KC_LCTL #define KC_LC KC_LCTL

@ -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 = 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 = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = yes # unicodemap
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
TAP_DANCE_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,24 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#define TAPPING_TERM 300
#define LEADER_TIMEOUT 400
#define DISABLE_SPACE_CADET_ROLLOVER
#define UNICODE_TYPE_DELAY 0
#define LSPO_KEY KC_9
#define RSPC_KEY KC_0
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 7
#define MOUSEKEY_WHEEL_DELAY 0
// place overrides here
#endif

@ -0,0 +1,224 @@
#include "frosty_flake.h"
#include "action_layer.h"
#include "eeconfig.h"
#include "process_unicode.h"
#include "process_unicodemap.h"
#include "quantum.h"
#define _______ KC_TRNS
//declarations for tap dancing emojis
void register_hex32(uint32_t hex);
void cycleEmojis(qk_tap_dance_state_t *state, void *user_data);
void cycleAnimals(qk_tap_dance_state_t *state, void *user_data);
void cycleHands(qk_tap_dance_state_t *state, void *user_data);
void tap(uint16_t keycode){
register_code(keycode);
unregister_code(keycode);
};
//Tap Dance Declarations
enum taps{
TD_CTCPS = 0,
EMOJIS,
ANIMAL,
HAND
};
enum unicode_name { // split every five emojis
THINK = 1, // thinking face 🤔
GRIN, // grinning face 😊
SMRK, // smirk 😏
WEARY, // good shit 😩
UNAMU, // unamused 😒
SNEK, // snke 🐍
PENGUIN, // 🐧
DRAGON, // 🐉
MONKEY, // 🐒
CHICK, // 🐥
OKOK, // 👌
EFFU, // 🖕
INUP, // 👆
THUP, // 👍
THDN, // 👎
BBB, // dat B 🅱
POO, // poop 💩
HUNDR, // 100 💯
EGGPL, // EGGPLANT 🍆
WATER, // wet 💦
LIT // fire 🔥
};
enum my_macros {
NEWDESK = 0,
LEFTDESK,
RIGHTDESK,
CLOSEDESK
};
enum quick {
DISFACE = 0,
TFLIP,
TPUT,
SHRUG,
FACE,
RANDIG
};
// Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// Tap once for CTRL, twice for Caps Lock
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
[HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL)
// Other declarations would go here, separated by commas, if you have them
};
// macros
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) {
case NEWDESK: // this would trigger when you hit a key mapped as M(0)
if (record->event.pressed) {
return MACRO( I(1), D(LGUI), D(LCTL), D(D), U(LGUI), U(LCTL), U(D), END ); // NEW DESKTOP
}
break;
case LEFTDESK: // this would trigger when you hit a key mapped as M(0)
if (record->event.pressed) {
return MACRO( I(1), D(LGUI), D(LCTL), D(LEFT), U(LGUI), U(LCTL), U(LEFT), END ); // LEFT DESKTOP
}
break;
case RIGHTDESK: // this would trigger when you hit a key mapped as M(0)
if (record->event.pressed) {
return MACRO( I(1), D(LGUI), D(LCTL), D(RGHT), U(LGUI), U(LCTL), U(RGHT), END ); // RIGHT DESKTOP
}
break;
case CLOSEDESK: // this would trigger when you hit a key mapped as M(0)
if (record->event.pressed) {
return MACRO( I(1), D(LGUI), D(LCTL), D(F4), U(LGUI), U(LCTL), U(F4), END ); // CLOSE DESKTOP
}
break;
}
return MACRO_NONE;
};
// emojis in unicode
const uint32_t PROGMEM unicode_map[] = {
[THINK] = 0x1F914,
[GRIN] = 0x1F600,
[BBB] = 0x1F171,
[POO] = 0x1F4A9,
[HUNDR] = 0x1F4AF,
[SMRK] = 0x1F60F,
[WEARY] = 0x1F629,
[EGGPL] = 0x1F346,
[WATER] = 0x1F4A6,
[LIT] = 0x1F525,
[UNAMU] = 0x1F612,
[SNEK] = 0x1F40D,
[PENGUIN] = 0x1F427,
[MONKEY] = 0x1F412,
[CHICK] = 0x1F425,
[DRAGON] = 0x1F409,
[OKOK] = 0x1F44C,
[EFFU] = 0x1F595,
[INUP] = 0x1F446,
[THDN] = 0x1F44E,
[THUP] = 0x1F44D
};
// Layouts
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(\
KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
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, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
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_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \
KC_LCTL, 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_P4, KC_P5, KC_P6, \
KC_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \
TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT),
[1] = KEYMAP(\
KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
TD(EMOJIS),TD(ANIMAL),TD(HAND),X(SMRK),X(WEARY),X(UNAMU), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
KC_TAB, KC_Q, M(0), KC_E, KC_R,X(EGGPL),X(WATER), KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
KC_LCTL, M(1), M(3), M(2), KC_F, X(LIT), X(SNEK), KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, X(HUNDR), X(BBB), X(POO), KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
[2] = KEYMAP(\
KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
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, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
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_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
KC_LCTL, KC_D, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, _______, _______, KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
};
LEADER_EXTERNS();
void matrix_scan_user(void) {
LEADER_DICTIONARY() {
leading = false;
leader_end();
SEQ_TWO_KEYS(KC_A, KC_A) { // select all and copy
register_code(KC_LCTL);
tap(KC_A);
tap(KC_C);
unregister_code(KC_LCTL);
}
}
}
void matrix_init_user(void) {
_delay_ms(500);
set_unicode_input_mode(UC_WINC);
};
void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) {
if(state->count == 1) {
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count]));
unicode_input_finish();
}
else if(state->count <= 5) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count]));
unicode_input_finish();
}
};
void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) {
if(state->count == 1) {
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
unicode_input_finish();
}
else if(state->count <= 5) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
unicode_input_finish();
}
};
void cycleHands(qk_tap_dance_state_t *state, void *user_data) {
if(state->count == 1) {
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
unicode_input_finish();
}
else if(state->count <= 5) {
tap(KC_BSPC);
unicode_input_start();
register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
unicode_input_finish();
}
};

@ -0,0 +1,24 @@
# The Nikchi's keymap for frosty_flake
### FEATURING
-SPACE CADET
-Caps Lock is now LCTRL
-LCTRL is Tap(LCTRL, Caps Lock)
### LEADER KEY - RALT
COMBOS
-a,a => Select All, Copy
### FN REBINDS for Windows
```
[W] [New Desktop]
[A][S][D] [Left Desk][Delete Desk][Right Desk]
[Ins][Hom][PUp] [RW][PP][FF]
[Del][End][PDn] [MU][VD][VU]
Arrows are Mouskeys, left three mods are clicks
```

@ -115,6 +115,7 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
} }
void matrix_print(void) { void matrix_print(void) {
#ifndef NO_PRINT
print("\nr\\c ABCDEFGHIJKLMNOPQR\n"); print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_row_t matrix_row = matrix_get_row(row); matrix_row_t matrix_row = matrix_get_row(row);
@ -125,6 +126,7 @@ void matrix_print(void) {
} }
print("\n"); print("\n");
} }
#endif
} }
uint8_t matrix_key_count(void) { uint8_t matrix_key_count(void) {

@ -54,8 +54,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400) CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration COMMAND_ENABLE ?= no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 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 # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work

@ -121,7 +121,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -131,17 +131,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _DV: case _DV:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DV);
} }
break; break;
case _QW: case _QW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_QW);
} }
break; break;
case _CM: case _CM:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); persistent_default_layer_set(1UL<<_CM);
} }
break; break;
} }

@ -7,7 +7,8 @@ Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c
*/ */
#include "babblePaste.h" #include "../MS_sculpt_mobile/babblePaste.h"
#include "action_macro.h" #include "action_macro.h"
#ifdef USE_BABLPASTE #ifdef USE_BABLPASTE

@ -9,9 +9,9 @@ and jeebak & algernon's keymap
*/ */
#ifndef _babblePaste_h_included__ #ifndef _babblePaste_h_included__
#define _babblePaste_h_included__ #define _babblePaste_h_included__
#include "../MS_sculpt_mobile/config.h"
#include "action_layer.h" #include "action_layer.h"
#include "quantum_keycodes.h" #include "quantum_keycodes.h"
#include "config.h"
#ifdef USE_BABLPASTE #ifdef USE_BABLPASTE

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

@ -1,4 +1,4 @@
#include "MS-sculpt-mobile.h" #include "../../MS_sculpt_mobile.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*

@ -1,7 +1,7 @@
#ifndef CONFIG_USER_H #ifndef CONFIG_USER_H
#define CONFIG_USER_H #define CONFIG_USER_H
#include "../../config.h" #include "../../../MS_sculpt_mobile/config.h"
#define USE_BABLPASTE #define USE_BABLPASTE

@ -1,7 +1,7 @@
#include "MS-sculpt-mobile.h" #include "../../../MS_sculpt_mobile/babblePaste.h"
#include "../../MS_sculpt_mobile.h"
#include "action_layer.h" #include "action_layer.h"
#include "action_util.h" #include "action_util.h"
#include "babblePaste.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#include "audio.h" #include "audio.h"

@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,----+----+----+----+----+----. ,----+----+----+----+----+----.
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, X0 , A , O , E , U , I , D , H , T , N , S ,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 ,
//|----+----+----+----+----+----|----+----|----+----+----+----+----+----| //|----+----+----+----+----+----|----+----|----+----+----+----+----+----|
@ -147,7 +147,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -159,7 +159,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -168,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -177,7 +177,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -186,7 +186,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -198,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -207,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -216,7 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -0,0 +1,15 @@
#define COLOR_BLANK 0, 0, 0
#define COLOR_BLACK 0, 0, 0
#define COLOR_WHITE 15,15,15
#define COLOR_GRAY 7, 7, 7
#define COLOR_RED 15, 0, 0
#define COLOR_GREEN 0,15, 0
#define COLOR_BLUE 0, 0,15
#define COLOR_YELLOW 15,15, 0
#define COLOR_MAGENTA 15, 0,15
#define COLOR_CYAN 0,15,15
#define COLOR_ORANGE 15, 5, 0

@ -35,12 +35,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION #define DESCRIPTION
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 6 #define MATRIX_COLS 6
#define MATRIX_ROWS 9
/* default pin-out */ /* default pin-out */
#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 } #define MATRIX_COL_PINS { F4, F1, F0, D6, D0, D1 }
#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 } #define MATRIX_ROW_PINS { F5, F6, F7 }
#define TRACKPOINT_PINS { B7, B6, D7 }
#define UNUSED_PINS #define UNUSED_PINS
/* /*
@ -152,17 +153,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
#define PS2_INIT_DELAY 2000 #define PS2_MOUSE_INIT_DELAY 2000
#define BATTERY_PIN 9 #define BATTERY_PIN 9
#define BATTERY_POLL 30000 #define BATTERY_POLL 30000
#define MAX_VOLTAGE 4.2 #define MAX_VOLTAGE 4.2
#define MIN_VOLTAGE 3.2 #define MIN_VOLTAGE 3.2
#define ___ KC_NO
#define KEYMAP( \ #define KEYMAP( \
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
tp1, tp2, tp3 \
) \ ) \
{ \ { \
{k11, k12, k13, k14, k15, k16}, \ {k11, k12, k13, k14, k15, k16}, \
@ -172,25 +176,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{k17, k18, k19, k1a, k1b, k1c}, \ {k17, k18, k19, k1a, k1b, k1c}, \
{k27, k28, k29, k2a, k2b, k2c}, \ {k27, k28, k29, k2a, k2b, k2c}, \
{k37, k38, k39, k3a, k3b, k3c}, \ {k37, k38, k39, k3a, k3b, k3c}, \
{k47, k48, k49, k4a, k4b, k4c} \ {k47, k48, k49, k4a, k4b, k4c}, \
{tp1, tp2, tp3, ___, ___, ___} \
} }
#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
enum led_sequence { enum led_sequence {
LED_IND_LINUX,
LED_IND_APPLE,
LED_IND_WINDOWS,
LED_IND_QWERTY,
LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH, LED_IND_BLUETOOTH,
LED_IND_USB, LED_IND_USB,
LED_IND_BATTERY,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN, LED_IND_FUN,
LED_IND_NUM, LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI, LED_IND_EMOJI,
LED_IND_GREEK,
LED_BKSP, LED_BKSP,
LED_ENT, LED_ENT,
LED_RSFT, LED_RSFT,
LED_RCTL, LED_RCTL,
LED_RGUI, LED_RALT,
LED_SLSH, LED_SLSH,
LED_SCLN, LED_SCLN,
LED_P, LED_P,
@ -198,9 +213,9 @@ enum led_sequence {
LED_O, LED_O,
LED_L, LED_L,
LED_DOT, LED_DOT,
LED_RALT, LED_RGUI,
LED_EMOJI, LED_GREEK,
LED_COMM, LED_COMM,
LED_K, LED_K,
LED_I, LED_I,
@ -219,35 +234,35 @@ enum led_sequence {
LED_TRACKPOINT2, LED_TRACKPOINT2,
LED_TRACKPOINT1, LED_TRACKPOINT1,
LED_LSPC,
LED_B,
LED_G,
LED_T, LED_T,
LED_G,
LED_B,
LED_LSPC,
LED_R,
LED_F,
LED_V,
LED_NUM, LED_NUM,
LED_V,
LED_F,
LED_R,
LED_PUNC,
LED_C,
LED_D,
LED_E, LED_E,
LED_D,
LED_C,
LED_EMPTY,
LED_W, LED_LGUI,
LED_S,
LED_X, LED_X,
LED_LALT, LED_S,
LED_W,
LED_LGUI,
LED_Z,
LED_A,
LED_Q, LED_Q,
LED_A,
LED_Z,
LED_LALT,
LED_TAB,
LED_ESC,
LED_LSFT,
LED_LCTL, LED_LCTL,
LED_LSFT,
LED_ESC,
LED_TAB,
LED_TOTAL LED_TOTAL
}; };
@ -261,7 +276,7 @@ enum led_sequence {
# define PS2_CLOCK_PORT PORTD # define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND # define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD # define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1 # define PS2_CLOCK_BIT 3
# define PS2_DATA_PORT PORTD # define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND # define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD # define PS2_DATA_DDR DDRD

@ -19,6 +19,8 @@ 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. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
PS2_MOUSE_ENABLE = yes PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes PS2_USE_INT = yes
FAUXCLICKY_ENABLE = yes
BLUETOOTH = AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

@ -37,8 +37,8 @@ On Promethium, USB or Bluetooth output is detected on startup. If USB is connect
SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively. SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases. SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes. On Promethium there are 16 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 67 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty.

@ -14,6 +14,7 @@
#define PREVENT_STUCK_MODIFIERS #define PREVENT_STUCK_MODIFIERS
#define RGBSPS_ENABLE #define RGBSPS_ENABLE
#define RGBSPS_DEMO_ENABLE
#define UNICODE_TYPE_DELAY 0 #define UNICODE_TYPE_DELAY 0

@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h" #include "quantum.h"
#ifdef RGBSPS_ENABLE #ifdef RGBSPS_ENABLE
#include "rgbsps.h" #include "rgbsps.h"
#include "rgbtheme.h"
#endif #endif
#ifdef PS2_MOUSE_ENABLE #ifdef PS2_MOUSE_ENABLE
#include "ps2_mouse.h" #include "ps2_mouse.h"
@ -38,6 +39,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif #endif
#ifdef FAUXCLICKY_ENABLE #ifdef FAUXCLICKY_ENABLE
#include "fauxclicky.h" #include "fauxclicky.h"
#ifdef RGBSPS_ENABLE
#undef FAUXCLICKY_OFF
#define FAUXCLICKY_OFF do { \
fauxclicky_enabled = false; \
rgbsps_set(LED_AUDIO, COLOR_BLANK); \
fauxclicky_stop(); \
} while (0)
#undef FAUXCLICKY_ON
#define FAUXCLICKY_ON do { \
fauxclicky_enabled = true; \
rgbsps_set(LED_AUDIO, THEME_COLOR_AUDIO); \
} while (0)
#endif
#endif #endif
#include "outputselect.h" #include "outputselect.h"
#include "led.h" #include "led.h"
@ -128,9 +142,10 @@ enum planck_keycodes {
#ifndef FAUXCLICKY_ENABLE #ifndef FAUXCLICKY_ENABLE
FC_TOG, FC_TOG,
#endif #endif
#ifndef ADAFRUIT_BLE_ENABLE #ifndef MODULE_ADAFRUIT_BLE
OUT_BLE, OUT_BT,
#endif #endif
RGBDEMO,
KEYCODE_END KEYCODE_END
}; };
@ -421,19 +436,30 @@ const uint8_t PROGMEM LED_MODS[] = {
}; };
const uint8_t PROGMEM LED_FN[] = { const uint8_t PROGMEM LED_FN[] = {
LED_PUNC, LED_EMPTY,
LED_NUM, LED_NUM,
LED_FUN, LED_FUN,
LED_EMOJI LED_GREEK
}; };
const uint8_t PROGMEM LED_INDICATORS[] = { const uint8_t PROGMEM LED_INDICATORS[] = {
LED_IND_EMOJI, LED_IND_LINUX,
LED_IND_NUM, LED_IND_APPLE,
LED_IND_FUN, LED_IND_WINDOWS,
LED_IND_BATTERY, LED_IND_QWERTY,
LED_IND_USB, LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH, LED_IND_BLUETOOTH,
LED_IND_USB,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN,
LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI,
LED_IND_GREEK,
}; };
const uint8_t PROGMEM LED_TRACKPOINT[] = { const uint8_t PROGMEM LED_TRACKPOINT[] = {
@ -444,15 +470,36 @@ const uint8_t PROGMEM LED_TRACKPOINT[] = {
void led_turnoff_keys(void) { void led_turnoff_keys(void) {
for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), COLOR_BLACK);
} }
for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_MODS[i]), COLOR_BLACK);
} }
for(uint8_t i = 0; i < COUNT(LED_FN); i++) { for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_FN[i]), COLOR_BLACK);
} }
}
#ifdef RGBSPS_DEMO_ENABLE
void led_demo(void) {
rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
rgbsps_send();
} }
#endif
void led_reset(void) { void led_reset(void) {
switch (glow_mode) { switch (glow_mode) {
@ -462,39 +509,55 @@ void led_reset(void) {
case GLOW_MIN: case GLOW_MIN:
led_turnoff_keys(); led_turnoff_keys();
for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 8, 8, 8); rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW1_HOME);
} }
rgbsps_set(LED_F, 15, 0, 0); rgbsps_set(LED_F, THEME_COLOR_GLOW1_HOMING);
rgbsps_set(LED_J, 15, 0, 0); rgbsps_set(LED_J, THEME_COLOR_GLOW1_HOMING);
break; break;
case GLOW_FULL: case GLOW_FULL:
for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 8, 8, 8); rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), THEME_COLOR_GLOW2_ALPHA);
} }
for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 15, 0); rgbsps_set(pgm_read_byte(&LED_MODS[i]), THEME_COLOR_GLOW2_MODS);
} }
for(uint8_t i = 0; i < COUNT(LED_FN); i++) { for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 15); rgbsps_set(pgm_read_byte(&LED_FN[i]), THEME_COLOR_GLOW2_FN);
} }
for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 15, 0, 0); rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW2_HOME);
} }
rgbsps_set(LED_F, 15, 15, 0); rgbsps_set(LED_F, THEME_COLOR_GLOW2_HOMING);
rgbsps_set(LED_J, 15, 15, 0); rgbsps_set(LED_J, THEME_COLOR_GLOW2_HOMING);
break; break;
} }
} }
void led_set_default_layer_indicator(void) {
uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) {
rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
rgbsps_set(LED_IND_ALT, COLOR_BLANK);
} else {
rgbsps_set(LED_IND_QWERTY, COLOR_BLANK);
rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
}
rgbsps_send();
return;
}
void led_set_layer_indicator(void) { void led_set_layer_indicator(void) {
static uint8_t oldlayer = 255; static uint8_t oldlayer = 255;
rgbsps_set(LED_IND_FUN, 0, 0, 0);
// rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
led_reset(); led_reset();
rgbsps_set(LED_IND_GUI, COLOR_BLANK);
rgbsps_set(LED_IND_FUN, COLOR_BLANK);
rgbsps_set(LED_IND_NUM, COLOR_BLANK);
rgbsps_set(LED_IND_PUNC, COLOR_BLANK);
rgbsps_set(LED_IND_GREEK, COLOR_BLANK);
rgbsps_set(LED_IND_EMOJI, COLOR_BLANK);
uint8_t layer = biton32(layer_state); uint8_t layer = biton32(layer_state);
if (oldlayer == layer) { if (oldlayer == layer) {
return; return;
@ -508,39 +571,72 @@ void led_set_layer_indicator(void) {
} }
switch(layer) { switch(layer) {
case _GUI:
rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
break;
case _FUN: case _FUN:
rgbsps_set(LED_IND_FUN, 15, 0, 0); rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
break;
case _NUM:
rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
break;
case _PUNC:
rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
break;
case _GREEKL:
case _GREEKU:
rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
break; break;
// case _NUM:
// rgbsps_set(LED_IND_NUM, 0, 0, 15);
// break;
case _EMOJI: case _EMOJI:
rgbsps_set(LED_IND_EMOJI, 15, 15, 0); rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
break; break;
default: default:
rgbsps_set(LED_IND_FUN, 3, 3, 3); rgbsps_set(LED_IND_GUI, THEME_COLOR_OTHERLAYER);
// rgbsps_set(LED_IND_NUM, 3, 3, 3); rgbsps_set(LED_IND_FUN, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_EMOJI, 3, 3, 3); rgbsps_set(LED_IND_NUM, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_PUNC, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_GREEK, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_EMOJI, THEME_COLOR_OTHERLAYER);
}
rgbsps_send();
} }
void led_set_unicode_input_mode(void) {
rgbsps_set(LED_IND_LINUX, COLOR_BLANK);
rgbsps_set(LED_IND_APPLE, COLOR_BLANK);
rgbsps_set(LED_IND_WINDOWS, COLOR_BLANK);
switch (get_unicode_input_mode()) {
case UC_LNX:
rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
break;
case UC_OSX:
rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
break;
case UC_WIN:
case UC_WINC:
rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
break;
}
rgbsps_send(); rgbsps_send();
} }
void led_set_output_ble(void) { void led_set_output_ble(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
rgbsps_set(LED_IND_USB, 0, 0, 0); rgbsps_set(LED_IND_USB, COLOR_BLANK);
rgbsps_send(); rgbsps_send();
} }
void led_set_output_usb(void) { void led_set_output_usb(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
rgbsps_set(LED_IND_USB, 15, 15, 15); rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
rgbsps_send(); rgbsps_send();
} }
void led_set_output_none(void) { void led_set_output_none(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
rgbsps_set(LED_IND_USB, 0, 0, 0); rgbsps_set(LED_IND_USB, COLOR_BLANK);
rgbsps_send(); rgbsps_send();
} }
@ -549,10 +645,30 @@ void led_init(void) {
rgbsps_turnoff(); rgbsps_turnoff();
// set trackpoint color // set trackpoint color
rgbsps_set(LED_TRACKPOINT1, 15, 0, 0); rgbsps_set(LED_TRACKPOINT1, THEME_COLOR_TP1);
rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT2, THEME_COLOR_TP2);
rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); rgbsps_set(LED_TRACKPOINT3, THEME_COLOR_TP3);
// unicode input mode
led_set_unicode_input_mode();
// layer indicator
led_set_layer_indicator();
led_set_default_layer_indicator();
// clicky
#ifdef FAUXCLICKY_ENABLE
if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
} else {
rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
} }
#endif
rgbsps_send();
}
#endif // RGBSPS_ENABLE #endif // RGBSPS_ENABLE
// keymaps // keymaps
@ -574,7 +690,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT ,
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL,
_______, _______, _______
), ),
/* Dvorak /* Dvorak
@ -593,7 +710,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______,
_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______,
_______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -614,7 +732,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______,
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -635,7 +754,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______,
_______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -656,7 +776,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______,
_______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______,
_______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -675,7 +796,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
_______, _______, _______
), ),
/* Num /* Num
@ -690,10 +812,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_NUM] = KEYMAP( [_NUM] = KEYMAP(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______,
_______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______ _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______,
_______, _______, _______
), ),
/* Func /* Func
@ -711,7 +834,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
_______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Uppercase Greek /* Uppercase Greek
@ -729,7 +853,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
_______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Lowercase Greek /* Lowercase Greek
@ -747,7 +872,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
_______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Empty /* Empty
@ -765,7 +891,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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, 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Emoji /* Emoji
@ -783,7 +910,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK) X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK),
_______, _______, _______
), ),
/* GUI /* GUI
@ -801,7 +929,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, 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,
_______, _______, _______
), ),
/* Sys /* Sys
@ -816,18 +945,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_SYS] = KEYMAP( [_SYS] = KEYMAP(
XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO,
XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______
), ),
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
#ifdef RGBSPS_ENABLE
led_set_default_layer_indicator();
#endif
} }
#ifdef DOUBLESPACE_LAYER_ENABLE #ifdef DOUBLESPACE_LAYER_ENABLE
@ -1001,14 +1134,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// layout switchers // layout switchers
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
#ifdef LAYOUT_DVORAK #ifdef LAYOUT_DVORAK
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;
@ -1016,7 +1149,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_COLEMAK #ifdef LAYOUT_COLEMAK
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -1024,7 +1157,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_WORKMAN #ifdef LAYOUT_WORKMAN
case WORKMAN: case WORKMAN:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_WORKMAN); persistent_default_layer_set(1UL<<_WORKMAN);
} }
return false; return false;
break; break;
@ -1032,7 +1165,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_NORMAN #ifdef LAYOUT_NORMAN
case NORMAN: case NORMAN:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_NORMAN); persistent_default_layer_set(1UL<<_NORMAN);
} }
return false; return false;
break; break;
@ -1072,14 +1205,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// OS switchers // OS switchers
case LINUX: case LINUX:
set_unicode_input_mode(UC_LNX); set_unicode_input_mode(UC_LNX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
case WIN: case WIN:
set_unicode_input_mode(UC_WINC); set_unicode_input_mode(UC_WINC);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
case OSX: case OSX:
set_unicode_input_mode(UC_OSX); set_unicode_input_mode(UC_OSX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
@ -1101,20 +1243,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// faux clicky indicator // faux clicky indicator
#ifdef FAUXCLICKY_ENABLE #ifdef FAUXCLICKY_ENABLE
case FC_TOG: case FC_TOG:
#ifdef RGBSPS_ENABLE
if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
} else {
rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
}
rgbsps_send();
#endif
return true; return true;
break; break;
#endif #endif
#ifdef RGBSPS_DEMO_ENABLE
case RGBDEMO:
led_demo();
return false;
break;
#endif
} }
return true; return true;
} }
void set_output_user(uint8_t output) { void set_output_user(uint8_t output) {
#ifdef ADAFRUIT_BLE_ENABLE #ifdef MODULE_ADAFRUIT_BLE
switch(output) { switch(output) {
case OUTPUT_USB: case OUTPUT_USB:
led_set_output_usb(); led_set_output_usb();
break; break;
case OUTPUT_ADAFRUIT_BLE: case OUTPUT_BLUETOOTH:
led_set_output_ble(); led_set_output_ble();
break; break;
default: default:
@ -1133,12 +1290,12 @@ void matrix_init_user() {
#endif #endif
// auto detect output on init // auto detect output on init
#ifdef ADAFRUIT_BLE_ENABLE #ifdef MODULE_ADAFRUIT_BLE
uint8_t output = auto_detect_output(); uint8_t output = auto_detect_output();
if (output == OUTPUT_USB) { if (output == OUTPUT_USB) {
set_output(OUTPUT_USB); set_output(OUTPUT_USB);
} else { } else {
set_output(OUTPUT_ADAFRUIT_BLE); set_output(OUTPUT_BLUETOOTH);
} }
#endif #endif
} }
@ -1164,9 +1321,9 @@ void turn_off_capslock() {
bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK); bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
if (new_capslock ^ capslock) { // capslock state is different if (new_capslock ^ capslock) { // capslock state is different
if ((capslock = new_capslock)) { if ((capslock = new_capslock)) {
rgbsps_set(LED_IND_NUM, 15, 0, 0); rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
} else { } else {
rgbsps_set(LED_IND_NUM, 0, 0, 0); rgbsps_set(LED_IND_CAPSLOCK, COLOR_BLANK);
} }
rgbsps_send(); rgbsps_send();
} }

@ -0,0 +1,36 @@
#include "color.h"
#define THEME_COLOR_LINUX COLOR_WHITE
#define THEME_COLOR_APPLE COLOR_WHITE
#define THEME_COLOR_WINDOWS COLOR_WHITE
#define THEME_COLOR_QWERTY COLOR_RED
#define THEME_COLOR_ALT COLOR_RED
#define THEME_COLOR_AUDIO COLOR_GREEN
#define THEME_COLOR_BLUETOOTH 7,7,15
#define THEME_COLOR_USB COLOR_WHITE
#define THEME_COLOR_CAPSLOCK COLOR_RED
#define THEME_COLOR_GUI COLOR_MAGENTA
#define THEME_COLOR_FUN COLOR_RED
#define THEME_COLOR_NUM 7,7,15
#define THEME_COLOR_PUNC COLOR_GREEN
#define THEME_COLOR_GREEK COLOR_CYAN
#define THEME_COLOR_EMOJI COLOR_YELLOW
#define THEME_COLOR_OTHERLAYER COLOR_GRAY
#define THEME_COLOR_GLOW1_HOME COLOR_ORANGE
#define THEME_COLOR_GLOW1_HOMING COLOR_RED
#define THEME_COLOR_GLOW2_ALPHA COLOR_ORANGE
#define THEME_COLOR_GLOW2_MODS COLOR_ORANGE
#define THEME_COLOR_GLOW2_FN COLOR_ORANGE
#define THEME_COLOR_GLOW2_HOME COLOR_ORANGE
#define THEME_COLOR_GLOW2_HOMING COLOR_RED
#define THEME_COLOR_TP1 COLOR_ORANGE
#define THEME_COLOR_TP2 COLOR_RED
#define THEME_COLOR_TP3 COLOR_ORANGE

@ -0,0 +1,36 @@
#include "color.h"
#define THEME_COLOR_LINUX COLOR_WHITE
#define THEME_COLOR_APPLE COLOR_WHITE
#define THEME_COLOR_WINDOWS COLOR_WHITE
#define THEME_COLOR_QWERTY COLOR_RED
#define THEME_COLOR_ALT COLOR_RED
#define THEME_COLOR_AUDIO COLOR_GREEN
#define THEME_COLOR_BLUETOOTH COLOR_BLUE
#define THEME_COLOR_USB COLOR_WHITE
#define THEME_COLOR_CAPSLOCK COLOR_RED
#define THEME_COLOR_GUI COLOR_MAGENTA
#define THEME_COLOR_FUN COLOR_RED
#define THEME_COLOR_NUM COLOR_BLUE
#define THEME_COLOR_PUNC COLOR_GREEN
#define THEME_COLOR_GREEK COLOR_CYAN
#define THEME_COLOR_EMOJI COLOR_YELLOW
#define THEME_COLOR_OTHERLAYER COLOR_GRAY
#define THEME_COLOR_GLOW1_HOME COLOR_GRAY
#define THEME_COLOR_GLOW1_HOMING COLOR_RED
#define THEME_COLOR_GLOW2_ALPHA COLOR_GRAY
#define THEME_COLOR_GLOW2_MODS COLOR_GREEN
#define THEME_COLOR_GLOW2_FN COLOR_BLUE
#define THEME_COLOR_GLOW2_HOME COLOR_RED
#define THEME_COLOR_GLOW2_HOMING COLOR_YELLOW
#define THEME_COLOR_TP1 COLOR_RED
#define THEME_COLOR_TP2 COLOR_BLUE
#define THEME_COLOR_TP3 COLOR_RED

@ -0,0 +1,306 @@
/*
Copyright 2012 Jun Wako
Copyright 2014 Jack Humbert
Copyright 2017 Priyadi Iman Nurcahyo
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 <stdint.h>
#include <stdbool.h>
#if defined(__AVR__)
#include <avr/io.h>
#endif
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "timer.h"
/* Set 0 if debouncing isn't needed */
#ifndef DEBOUNCING_DELAY
# define DEBOUNCING_DELAY 5
#endif
#if (DEBOUNCING_DELAY > 0)
static uint16_t debouncing_time;
static bool debouncing = false;
#endif
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif
#ifdef MATRIX_MASKED
extern const matrix_row_t matrix_mask[];
#endif
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
static const uint8_t tp_pins[3] = TRACKPOINT_PINS;
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static void init_cols(void);
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
static void unselect_rows(void);
static void select_row(uint8_t row);
static void unselect_row(uint8_t row);
__attribute__ ((weak))
void matrix_init_quantum(void) {
matrix_init_kb();
}
__attribute__ ((weak))
void matrix_scan_quantum(void) {
matrix_scan_kb();
}
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
void matrix_init(void) {
// To use PORTF disable JTAG with writing JTD bit twice within four cycles.
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
MCUCR |= _BV(JTD);
MCUCR |= _BV(JTD);
#endif
// initialize row and col
unselect_rows();
init_cols();
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
matrix_init_quantum();
}
uint8_t matrix_scan(void)
{
// Set row, read cols
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
# if (DEBOUNCING_DELAY > 0)
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
if (matrix_changed) {
debouncing = true;
debouncing_time = timer_read();
}
# else
read_cols_on_row(matrix, current_row);
# endif
}
# if (DEBOUNCING_DELAY > 0)
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
debouncing = false;
}
# endif
matrix_scan_quantum();
return 1;
}
bool matrix_is_modified(void)
{
#if (DEBOUNCING_DELAY > 0)
if (debouncing) return false;
#endif
return true;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
// switch blocker installed and the switch is always pressed.
#ifdef MATRIX_MASKED
return matrix[row] & matrix_mask[row];
#else
return matrix[row];
#endif
}
void matrix_print(void)
{
print_matrix_header();
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row); print(": ");
print_matrix_row(row);
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}
#define ROW_MASK 0b11100000
static const uint8_t row_bit[MATRIX_ROWS] = {
// 76543210
0b00000000,
0b00100000,
0b01000000,
0b01100000,
0b10000000,
0b10100000,
0b11000000,
0b11100000,
};
static void init_cols(void)
{
// columns
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
uint8_t pin = col_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
// rows
DDRF |= ROW_MASK;
PORTF &= ~ROW_MASK;
// trackpoint
for(uint8_t x = 0; x < 3; x++) {
uint8_t pin = tp_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
{
// Store last value of row prior to reading
matrix_row_t last_row_value = current_matrix[current_row];
// Clear data in matrix row
current_matrix[current_row] = 0;
// special case for trackpoint
if (current_row == 8) {
for(uint8_t tp_index = 0; tp_index < 3; tp_index++) {
// Select the TP pin to read (active low)
uint8_t pin = tp_pins[tp_index];
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
// Populate the matrix row with the state of the col pin
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << tp_index);
}
return (last_row_value != current_matrix[current_row]);
}
// Select row and wait for row selecton to stabilize
select_row(current_row);
_delay_us(5); // without this wait it won't read stable value.
// wait_us(50);
// For each col...
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
// Select the col pin to read (active low)
uint8_t pin = col_pins[col_index];
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
// Populate the matrix row with the state of the col pin
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
}
// Unselect row
unselect_row(current_row);
return (last_row_value != current_matrix[current_row]);
}
static void select_row(uint8_t row)
{
PORTF = row_bit[row] | (PORTF & ~ROW_MASK);
}
static void unselect_row(uint8_t row)
{
}
static void unselect_rows(void)
{
}

@ -2,6 +2,11 @@
#include "analog.h" #include "analog.h"
#include "timer.h" #include "timer.h"
#include "matrix.h" #include "matrix.h"
#include "musical_notes.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25);
// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}

@ -65,8 +65,9 @@ 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. RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
PS2_MOUSE_ENABLE ?= yes PS2_MOUSE_ENABLE ?= yes
PS2_USE_INT ?= yes PS2_USE_INT ?= yes
ADAFRUIT_BLE_ENABLE ?= yes
API_SYSEX_ENABLE ?= no API_SYSEX_ENABLE ?= no
CUSTOM_MATRIX ?= yes
BLUETOOTH ?= AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
@ -74,3 +75,4 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
SRC += $(QUANTUM_DIR)/light_ws2812.c SRC += $(QUANTUM_DIR)/light_ws2812.c
SRC += rgbsps.c SRC += rgbsps.c
SRC += $(QUANTUM_DIR)/analog.c SRC += $(QUANTUM_DIR)/analog.c
SRC += matrix.c

@ -0,0 +1,23 @@
# cinaeco's HHKB firmware
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = 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.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,23 @@
# QMK Keyboard Firmware for HHKB
## Modifications
### HHKB Fn Layer
Added some Media keys.
### Utility Layer (SpaceFN)
Hold `Space` for:
- Vi-style direction keys.
- WASD-style mouse keys.
- Dynamic macro playback on `1` and `2`.
- Qwerty/Colemak/Dvorak layout selection on `-`, `=` and `\ `
### Dynamic Macros
Hold `q` and press:
- `1` or `2` to record macro 1 or 2.
- `s` to stop recording.

@ -0,0 +1,20 @@
#ifndef CONFIG_CINAECO_H
#define CONFIG_CINAECO_H
#include "../../config.h"
#undef MANUFACTURER
#undef PRODUCT
#undef DESCRIPTION
#define MANUFACTURER QMK
#define PRODUCT HHKB QMK cinaeco
#define DESCRIPTION HHKB on QMK Firmware with cinaeco keymap
// Increase "Tap" detection window. Avoid missing 'q' or 'z' when typing slowly.
#undef TAPPING_TERM
#define TAPPING_TERM 230
// Uncomment to enable NKRO by default. May cause issues with KVM switches.
//#define FORCE_NKRO
#endif

@ -0,0 +1,186 @@
/* -*- eval: (turn-on-orgtbl); -*-
* cinaeco's HHKB Layout
*/
#include "hhkb.h"
// Layers.
#define QWER 0
#define COLE 1
#define DVOR 2
#define HHKB 3
#define UTIL 4
#define MREC 5
// Easier-to-read Layer Arrays.
#define ____ KC_TRNS
enum hhkb_keycodes {
DYNAMIC_MACRO_RANGE = SAFE_RANGE,
};
#include "dynamic_macro.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWER Layer: Qwerty Default
*
* ,--------------------------------------------------------------.
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
* |--------------------------------------------------------------|
* |Tab |Q/MREC| W| E| R| T| Y| U| I| O| P| [| ]|Backs|
* |--------------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ent/Ctrl|
* |--------------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
* `--------------------------------------------------------------'
* |Alt|Gui | Space/UTIL |Gui |Alt|
* `-------------------------------------------'
*
*/
[QWER] = KEYMAP(
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_BSLS, KC_GRV, \
KC_TAB, LT(MREC, 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_BSPC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, CTL_T(KC_ENT), \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
/* COLE Layer: Colemak
*
* ,--------------------------------------------------------------.
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
* |--------------------------------------------------------------|
* |Tab |Q/MREC| W| F| P| G| J| L| U| Y| ;| [| ]|Backs|
* |--------------------------------------------------------------|
* |Ctrl | A| R| S| T| D| H| N| E| I| O| '|Ent/Ctrl|
* |--------------------------------------------------------------|
* |Shift | Z| X| C| V| K| B| M| ,| .| /|Shift |Fn0|
* `--------------------------------------------------------------'
* |Alt|Gui | Space/UTIL |Gui |Alt|
* `-------------------------------------------'
*
*/
[COLE] = KEYMAP(
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_BSLS, KC_GRV, \
KC_TAB, LT(MREC, 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_BSPC, \
KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, CTL_T(KC_ENT), \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_K, KC_B, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
/* DVOR Layer: Dvorak
*
* ,--------------------------------------------------------------.
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `|
* |--------------------------------------------------------------|
* |Tab |'/MREC| ,| .| P| Y| F| G| C| R| L| /| =|Backs|
* |--------------------------------------------------------------|
* |Ctrl | A| O| E| U| I| D| H| T| N| S| -|Ent/Ctrl|
* |--------------------------------------------------------------|
* |Shift | ;| Q| J| K| X| B| M| W| V| Z|Shift |Fn0|
* `--------------------------------------------------------------'
* |Alt|Gui | Space/UTIL |Gui |Alt|
* `-------------------------------------------'
*
*/
[DVOR] = KEYMAP(
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_BSLS, KC_GRV, \
KC_TAB, LT(MREC, 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_BSPC, \
KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, CTL_T(KC_ENT), \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(HHKB), \
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
/* HHKB Layer: HHKB mode (HHKB Fn)
*
* ,-----------------------------------------------------------.
* |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Caps |PLA|PRV|NXT| | | | |Psc|Slk|Pus|Up | |Backs|
* |-----------------------------------------------------------|
* | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter |
* |-----------------------------------------------------------|
* | | | | | | | +| -|End|PgD|Dow| | |
* `-----------------------------------------------------------'
* | | | |STOP | |
* `-------------------------------------------'
*/
[HHKB] = KEYMAP(
KC_PWR, 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_INS, KC_DEL, \
KC_CAPS, KC_MPLY, KC_MPRV, KC_MNXT, ____, ____, ____, ____, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ____, KC_BSPC, \
____, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, ____, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
____, ____, ____, ____, ____, ____, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ____, ____, \
____, ____, ____, KC_MSTP, ____),
/* UTIL Layer: Extra utilities
*
* ,-------------------------------------------------------------.
* |DFU|PLY1|PLY2| | | | | | | | |QWE|COL|DVO|DBG|
* |-------------------------------------------------------------|
* | |MLB |M-Up|MRB|MwU| |Hom|PgD|PgU|End| | | | |
* |-------------------------------------------------------------|
* | |M-Lt|M-Dn|M-R|MwD| |LEF|DOW|UP |RIG| | | |
* |-------------------------------------------------------------|
* | | | | | |SPC| | | | | | | |
* `-------------------------------------------------------------'
* | | | | | |
* `-------------------------------------------'
*
*/
[UTIL] = KEYMAP(
RESET, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG, \
____, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, ____, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ____, ____, ____, ____, \
____, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ____, ____, ____, \
____, ____, ____, ____, ____, KC_SPC, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____),
/* MREC Layer: Record macros with `q`
*
* ,-------------------------------------------------------------.
* | |REC1|REC2| | | | | | | | | | | | |
* |-------------------------------------------------------------|
* | | | | | | | | | | | | | | |
* |-------------------------------------------------------------|
* | | |RSTP| | | | | | | | | | |
* |-------------------------------------------------------------|
* | | | | | | | | | | | | | |
* `-------------------------------------------------------------'
* | | | | | |
* `-------------------------------------------'
*
*/
[MREC] = KEYMAP(
____, DYN_REC_START1, DYN_REC_START2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, DYN_REC_STOP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____)
};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE;
};
// For Dynamic Macros.
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_dynamic_macro(keycode, record)) {
return false;
}
return true;
}

@ -0,0 +1,176 @@
/* -*- eval: (turn-on-orgtbl); -*-
* default HHKB Layout
*/
#include "hhkb.h"
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _HHKB 3
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
HHKB
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
// Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift)
#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer QWERTY: Qwerty Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_QWERTY] = KEYMAP( // Qwerty layer
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_BSLS, MEH_GRV, \
HPR_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_BSPC, \
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, SFT_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer COLEMAK: Colemak Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | R | S | T | D | H | N | E | I | O | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | K | M | , | . | / | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_COLEMAK] = KEYMAP( // Colemak layer
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_BSLS, MEH_GRV, \
HPR_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_BSPC, \
CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, SFT_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer DVORAK: Dvorak Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | O | E | U | I | D | H | T | N | S | - | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[_DVORAK] = KEYMAP( // Dvorak layer
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_BSLS, MEH_GRV, \
HPR_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_BSPC, \
CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, SFT_ENT, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(_HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer HHKB: HHKB mode (HHKB Fn)
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
| | | Qwt | Cmk | Dvk | | + | - | End | PgD | Dow | | | | |
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|------+------+----------------------+------+------+
| **** | **** | ******************** | **** | **** |
|------+------+----------------------+------+------+
*/
[_HHKB] = KEYMAP(
KC_PWR, 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_INS, KC_DEL, \
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
_______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
_______, _______, _______, _______, _______)};
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;
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
}
return true;
}

@ -53,7 +53,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#OPT_DEFS += -DBOOTLOADER_SIZE=4096 #OPT_DEFS += -DBOOTLOADER_SIZE=4096
# as per original hasu settings # as per original hasu settings
OPT_DEFS += -DBOOTLOADER_SIZE=512 OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.

@ -283,7 +283,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

@ -8,7 +8,7 @@ needed, they will be mapped to home row keys. The `keymap.c` file will contain
the exact changes. The diagrams in this README shows the highlights of the the exact changes. The diagrams in this README shows the highlights of the
changes from the default mappings. changes from the default mappings.
I also decided to change all calls to `persistant_default_layer_set()` to I also decided to change all calls to `persistent_default_layer_set()` to
`default_layer_set()` since this is my personal perference. `default_layer_set()` since this is my personal perference.
## Macros ## Macros

@ -269,7 +269,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -279,17 +279,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _DV: case _DV:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DV);
} }
break; break;
case _QW: case _QW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_QW);
} }
break; break;
case _CM: case _CM:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); persistent_default_layer_set(1UL<<_CM);
} }
break; break;
} }

@ -22,7 +22,7 @@
#undef MOUSEKEY_WHEEL_MAX_SPEED #undef MOUSEKEY_WHEEL_MAX_SPEED
#define MOUSEKEY_WHEEL_MAX_SPEED 3 #define MOUSEKEY_WHEEL_MAX_SPEED 3
#undef MOUSEKEY_WHEEL_TIME_TO_MAX #undef MOUSEKEY_WHEEL_TIME_TO_MAX
#define MOUSEKEY_WHEEL_TIME_TO_MAX 1000 #define MOUSEKEY_WHEEL_TIME_TO_MAX 255
#undef ONESHOT_TIMEOUT #undef ONESHOT_TIMEOUT
#define ONESHOT_TIMEOUT 500 #define ONESHOT_TIMEOUT 500
#undef TAPPING_TOGGLE #undef TAPPING_TOGGLE

@ -186,7 +186,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
bool TOG_STATUS = false; bool TOG_STATUS = false;
int RGB_current_mode; int RGB_current_mode;
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -208,7 +208,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -217,7 +217,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -226,7 +226,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -138,7 +138,7 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -150,7 +150,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -159,7 +159,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -168,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -147,7 +147,7 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -159,7 +159,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -168,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -177,7 +177,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -147,7 +147,7 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -159,7 +159,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -168,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -177,7 +177,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -152,7 +152,7 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -164,7 +164,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -173,7 +173,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -182,7 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -141,7 +141,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -150,19 +150,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

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

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

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

@ -0,0 +1,5 @@
#include "m10a.h"
void matrix_init_kb(void) {
matrix_init_user();
}

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

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

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

@ -0,0 +1,87 @@
/*
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 unknown
#define PRODUCT Mitosis
#define DESCRIPTION q.m.k. keyboard firmware for Mitosis
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 10
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
#define ONESHOT_TIMEOUT 500
/* 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.
*/
#define PREVENT_STUCK_MODIFIERS
/* 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
//UART settings for communication with the RF microcontroller
#define SERIAL_UART_BAUD 1000000
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
#define SERIAL_UART_INIT() do { \
/* baud rate */ \
UBRR1L = SERIAL_UART_UBRR; \
/* baud rate */ \
UBRR1H = SERIAL_UART_UBRR >> 8; \
/* enable TX and RX */ \
UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
/* 8-bit data */ \
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
} while(0)
#endif

@ -0,0 +1,221 @@
// 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 "mitosis.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.
enum mitosis_layers
{
_MALT,
_SHIFTED,
_FUNCTION,
_FUNCSHIFT
};
enum mitosis_keycodes
{
FNKEY = SAFE_RANGE,
SHIFT
};
// Macro definitions for readability
enum mitosis_macros
{
VOLU,
VOLD,
ESCM
};
#define LONGPRESS_DELAY 150
#define LAYER_TOGGLE_DELAY 300
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MALT] = { /* Malt Layout, customised for reduced columns (ex: quote and shift locations) */
{KC_Q, KC_P, KC_Y, KC_C, KC_B, KC_V, KC_M, KC_U, KC_Z, KC_L },
{KC_A, KC_N, KC_I, KC_S, KC_F, KC_D, KC_T, KC_H, KC_O, KC_R },
{KC_COMM, KC_DOT, KC_J, KC_G, KC_SLSH, KC_SCLN, KC_W, KC_K, KC_QUOT, KC_X },
{XXXXXXX, M(VOLU), M(ESCM), KC_TAB, KC_LCTL, KC_LALT, KC_ENT, KC_DEL, KC_PGUP, XXXXXXX },
{XXXXXXX, M(VOLD), KC_LGUI, KC_E, FNKEY, SHIFT, KC_SPC, KC_BSPC, KC_PGDN, XXXXXXX }
},
[_SHIFTED] = { /* Shifted Layer, layered so that tri_layer can be used, or selectively
able to modify individual key's shifted behaviour */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
},
[_FUNCTION] = { /* Function Layer, primary alternative layer featuring numpad on right hand,
cursor keys on left hand, and all symbols*/
{KC_AMPR, KC_PERC, KC_UP, KC_CIRC, KC_PIPE, KC_LBRC, KC_7, KC_8, KC_9, KC_MINS },
{KC_AT, KC_LEFT, KC_DOWN, KC_RGHT, KC_HASH, KC_LPRN, KC_4, KC_5, KC_6, KC_PLUS },
{KC_ASTR, KC_UNDS, KC_EXLM, KC_DLR, KC_BSLS, KC_LCBR, KC_1, KC_2, KC_3, KC_ENT },
{XXXXXXX, KC_HOME, KC_GRV, KC_PWR, _______, _______, KC_EQL, KC_TILD, KC_DOT, XXXXXXX },
{XXXXXXX, KC_END, _______, _______, _______, _______, KC_0, _______, KC_PSCR, XXXXXXX }
},
[_FUNCSHIFT] = { /* Function Shifted Layer, secondary alternative layer with closing brackets,
and F-keys under their numpad equivalents*/
{_______, _______, _______, _______, _______, KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10 },
{_______, _______, _______, _______, _______, KC_RPRN, KC_F4, KC_F5, KC_F6, KC_F11 },
{_______, _______, _______, _______, _______, KC_RCBR, KC_F1, KC_F2, KC_F3, KC_F12 },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX },
{XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX }
}
};
const uint16_t PROGMEM fn_actions[] = {
};
static uint16_t key_timer;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
//switch multiplexing for media, short tap for volume up, long press for play/pause
case VOLU:
if (record->event.pressed) {
key_timer = timer_read(); // if the key is being pressed, we start the timer.
} else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down").
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) { // LONGPRESS_DELAY being 150ms, the threshhold we pick for counting something as a tap.
return MACRO(T(MPLY), END);
} else {
return MACRO(T(VOLU), END);
}
}
break;
//switch multiplexing for media, short tap for volume down, long press for next track
case VOLD:
if (record->event.pressed) {
key_timer = timer_read();
} else {
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
return MACRO(T(MNXT), END);
} else {
return MACRO(T(VOLD), END);
}
}
break;
//switch multiplexing for escape, short tap for escape, long press for context menu
case ESCM:
if (record->event.pressed) {
key_timer = timer_read();
} else {
if (timer_elapsed(key_timer) > LONGPRESS_DELAY) {
return MACRO(T(APP), END);
} else {
return MACRO(T(ESC), END);
}
}
break;
break;
}
return MACRO_NONE;
};
static bool singular_key = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
uint8_t layer;
layer = biton32(layer_state); // get the current layer
//custom layer handling for tri_layer,
switch (keycode) {
case FNKEY:
if (record->event.pressed) {
key_timer = timer_read();
singular_key = true;
layer_on(_FUNCTION);
} else {
if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
layer_off(_FUNCTION);
}
}
update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
return false;
break;
//SHIFT is handled as LSHIFT in the general case
case SHIFT:
if (record->event.pressed) {
key_timer = timer_read();
singular_key = true;
layer_on(_SHIFTED);
register_code(KC_LSFT);
} else {
if (timer_elapsed(key_timer) < LAYER_TOGGLE_DELAY || !singular_key) {
layer_off(_SHIFTED);
unregister_code(KC_LSFT);
}
}
update_tri_layer(_FUNCTION, _SHIFTED, _FUNCSHIFT);
return false;
break;
//If any other key was pressed during the layer mod hold period,
//then the layer mod was used momentarily, and should block latching
default:
singular_key = false;
break;
}
//FUNCSHIFT has been shifted by the SHIFT handling, some keys need to be excluded
if (layer == _FUNCSHIFT) {
//F1-F12 should be sent as unshifted keycodes,
//and ] needs to be unshifted or it is sent as }
if ( (keycode >= KC_F1 && keycode <= KC_F12)
|| keycode == KC_RBRC ) {
if (record->event.pressed) {
unregister_mods(MOD_LSFT);
} else {
register_mods(MOD_LSFT);
}
}
}
return true;
};
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
case _MALT:
set_led_off;
break;
case _FUNCTION:
set_led_blue;
break;
case _SHIFTED:
set_led_red;
break;
case _FUNCSHIFT:
set_led_green;
break;
default:
break;
}
};

@ -0,0 +1,164 @@
/*
Copyright 2012 Jun Wako
Copyright 2014 Jack Humbert
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 <stdint.h>
#include <stdbool.h>
#if defined(__AVR__)
#include <avr/io.h>
#endif
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "timer.h"
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
__attribute__ ((weak))
void matrix_init_quantum(void) {
matrix_init_kb();
}
__attribute__ ((weak))
void matrix_scan_quantum(void) {
matrix_scan_kb();
}
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
void matrix_init(void) {
matrix_init_quantum();
}
uint8_t matrix_scan(void)
{
SERIAL_UART_INIT();
uint32_t timeout = 0;
//the s character requests the RF slave to send the matrix
SERIAL_UART_DATA = 's';
//trust the external keystates entirely, erase the last data
uint8_t uart_data[11] = {0};
//there are 10 bytes corresponding to 10 columns, and an end byte
for (uint8_t i = 0; i < 11; i++) {
//wait for the serial data, timeout if it's been too long
//this only happened in testing with a loose wire, but does no
//harm to leave it in here
while(!SERIAL_UART_RXD_PRESENT){
timeout++;
if (timeout > 10000){
break;
}
}
uart_data[i] = SERIAL_UART_DATA;
}
//check for the end packet, the key state bytes use the LSBs, so 0xE0
//will only show up here if the correct bytes were recieved
if (uart_data[10] == 0xE0)
{
//shifting and transferring the keystates to the QMK matrix variable
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5;
}
}
matrix_scan_quantum();
return 1;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
return matrix[row];
}
void matrix_print(void)
{
print_matrix_header();
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row); print(": ");
print_matrix_row(row);
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += matrix_bitpop(i);
}
return count;
}

@ -0,0 +1,31 @@
#include "mitosis.h"
void uart_init(void) {
SERIAL_UART_INIT();
}
void led_init(void) {
DDRD |= (1<<1);
PORTD |= (1<<1);
DDRF |= (1<<4) | (1<<5);
PORTF |= (1<<4) | (1<<5);
}
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
uart_init();
led_init();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
void led_set_kb(uint8_t usb_led) {
}

@ -0,0 +1,67 @@
#ifndef MITOSIS_H
#define MITOSIS_H
#include "quantum.h"
#include "matrix.h"
#include "backlight.h"
#include <stddef.h>
#define red_led_off PORTF |= (1<<5)
#define red_led_on PORTF &= ~(1<<5)
#define blu_led_off PORTF |= (1<<4)
#define blu_led_on PORTF &= ~(1<<4)
#define grn_led_off PORTD |= (1<<1)
#define grn_led_on PORTD &= ~(1<<1)
#define set_led_off red_led_off; grn_led_off; blu_led_off
#define set_led_red red_led_on; grn_led_off; blu_led_off
#define set_led_blue red_led_off; grn_led_off; blu_led_on
#define set_led_green red_led_off; grn_led_on; blu_led_off
#define set_led_yellow red_led_on; grn_led_on; blu_led_off
#define set_led_magenta red_led_on; grn_led_off; blu_led_on
#define set_led_cyan red_led_off; grn_led_on; blu_led_on
#define set_led_white red_led_on; grn_led_on; blu_led_on
/*
#define LED_B 5
#define LED_R 6
#define LED_G 7
#define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define red_led_on PORTF |= (1<<LED_R)
#define red_led_off PORTF &= ~(1<<LED_R)
#define grn_led_on PORTF |= (1<<LED_G)
#define grn_led_off PORTF &= ~(1<<LED_G)
#define blu_led_on PORTF |= (1<<LED_B)
#define blu_led_off PORTF &= ~(1<<LED_B)
#define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R)
#define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B)
#define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G)
#define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G)
#define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B)
#define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G)
#define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G)
*/
// 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, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k31, k32, k33, k34, k35, k36, k37, k38, \
k41, k42, k43, k44, k45, k46, k47, k48 \
) \
{ \
{ 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 }, \
{ KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO } \
{ KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO }, \
}
#endif

@ -0,0 +1,33 @@
Mitosis Keyboard Firmware
======================
These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
Build log of the keyboard can be found [here](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/)
Hardware design files can be found [here](https://github.com/reversebias/mitosis-hardware)
Firmware for the nordic MCUs can be found [here](https://github.com/reversebias/mitosis)
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme](/).
## Building
Download or clone the whole firmware and navigate to the keyboards/atreus 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 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 a keymap like this:
```
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

@ -0,0 +1,81 @@
OPT_DEFS += -DMITOSIS_PROMICRO
OPT_DEFS += -DCATERINA_BOOTLOADER
MITOSIS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
# # project specific files
SRC = matrix.c
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
CUSTOM_MATRIX ?= yes # Remote matrix from the wireless bridge
# 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/ttyACM0
upload: build
$(MITOSIS_UPLOAD_COMMAND)

@ -163,6 +163,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN D0 // The pin your RGB strip is wired to #define RGB_DI_PIN D0 // The pin your RGB strip is wired to
#define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio)
#define RGBLED_NUM 7 // Number of LEDs #define RGBLED_NUM 7 // Number of LEDs
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17 #define RGBLIGHT_VAL_STEP 17

@ -0,0 +1,21 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

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

@ -0,0 +1,119 @@
#include "miuni32.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Level 0: Default Layer
* ,---------------------------------------------------------------------------------------.
* | Q | W | E | R | T | Y | U | I | O | P | BSP |
* |---------------------------------------------------------------------------------------|
* | A | S | D | F | G | H | J | K | L | ENT |LT(1|,)|
* |---------------------------------------------------------------------------------------|
* |LT(3|Z)| X | C | V | NO | SPC | B | N | M | RSFT |LT(2|.)|
* |---------------------------------------------------------------------------------------|
*/
[0] ={
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, LT(1, KC_COMMA)},
{LT(3, KC_Z), KC_X, KC_C, KC_V, KC_NO, KC_SPC, KC_B, KC_N, KC_M, KC_RSFT, LT(2, KC_DOT)}
},
/* Level 1: Numbers Layer
* ,---------------------------------------------------------------------------------------.
* | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
* |---------------------------------------------------------------------------------------|
* | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | PGUP | TRNS |
* |---------------------------------------------------------------------------------------|
* | LATL | 1 | 2 | 3 | 0 | NO | LEFT | DOWN | RGHT | PGDN | RSHFT |
* |---------------------------------------------------------------------------------------|
*/
[1] ={
{KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
{KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS},
{KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_RSFT}
},
/* Level 2: Symbols Layer
* ,---------------------------------------------------------------------------------------.
* | ! | @ | # | $ | % | ^ | & | * | - | + | = |
* |---------------------------------------------------------------------------------------|
* | { | } | [ | ] | TRNS | TRNS | \ | ; | : | ` | ? |
* |---------------------------------------------------------------------------------------|
* | LSFT | LCTL | L | T | TRNS | TAB | N | TRNS | TRNS | RCTL | TRNS |
* |---------------------------------------------------------------------------------------|
*/
[2] ={
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL},
{KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_BSLS, KC_SCLN, KC_COLN, KC_GRV, KC_QUES},
{KC_LSFT, KC_LCTL, KC_L, KC_T, KC_TRNS, KC_TAB, KC_N, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS}
},
/* Level 3: RGB Layer
* ,---------------------------------------------------------------------------------------.
* | RESET | TRNS | TRNS | TRNS | TRNS | F1 | F2 | F3 | F4 | F5 | F6 |
* |---------------------------------------------------------------------------------------|
* |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD| NO |RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| TRNS | TRNS |
* |---------------------------------------------------------------------------------------|
* | TRNS | TRNS | TRNS | TRNS | NO | F7 | F8 | F9 | F10 | F11 | F12 |
* |---------------------------------------------------------------------------------------|
*/
[3] ={
{RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6},
{RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_NO, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}
}
};
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;
};
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) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

@ -0,0 +1 @@
# The default keymap for miuni32

@ -1,20 +1,63 @@
#include "miuni32.h" #include "miuni32.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Level 0: Default Layer
* ,---------------------------------------------------------------------------------------.
* | Q | W | E | R | T | Y | U | I | O | P | BSP |
* |---------------------------------------------------------------------------------------|
* | A | S | D | F | G | H | J | K | L | ENT |LT(1|,)|
* |---------------------------------------------------------------------------------------|
* |LT(3|Z)| X | C | V | NO | SPC | B | N | M | RSFT |LT(2|.)|
* |---------------------------------------------------------------------------------------|
*/
[0] ={ [0] ={
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, KC_ENT}, {KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, LT(1, KC_COMMA)},
{KC_Z, KC_X, KC_C, KC_V, KC_V, KC_SPC, KC_B, KC_N, KC_M , MO(1), KC_RCTL} {LT(3, KC_Z), KC_X, KC_C, KC_V, KC_NO, KC_SPC, KC_B, KC_N, KC_M, KC_RSFT, LT(2, KC_DOT)}
}, },
/* Level 1: Numbers Layer
* ,---------------------------------------------------------------------------------------.
* | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
* |---------------------------------------------------------------------------------------|
* | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | PGUP | TRNS |
* |---------------------------------------------------------------------------------------|
* | LATL | 1 | 2 | 3 | 0 | NO | LEFT | DOWN | RGHT | PGDN | RSHFT |
* |---------------------------------------------------------------------------------------|
*/
[1] ={ [1] ={
{KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL}, {KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
{KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_TRNS}, {KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS},
{RGB_TOG, RGB_HUI, RGB_HUD, RGB_SAI, KC_TRNS, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, RGB_MOD}, {KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_RSFT}
},
/* Level 2: Symbols Layer
* ,---------------------------------------------------------------------------------------.
* | ! | @ | # | $ | % | ^ | & | * | - | + | = |
* |---------------------------------------------------------------------------------------|
* | { | } | [ | ] | TRNS | TRNS | \ | ; | : | ` | ? |
* |---------------------------------------------------------------------------------------|
* | LSFT | LCTL | L | T | TRNS | TAB | N | TRNS | TRNS | RCTL | TRNS |
* |---------------------------------------------------------------------------------------|
*/
[2] ={
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL},
{KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_BSLS, KC_SCLN, KC_COLN, KC_GRV, KC_QUES},
{KC_LSFT, KC_LCTL, KC_L, KC_T, KC_TRNS, KC_TAB, KC_N, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS}
},
/* Level 3: RGB Layer
* ,---------------------------------------------------------------------------------------.
* | RESET | TRNS | TRNS | TRNS | TRNS | F1 | F2 | F3 | F4 | F5 | F6 |
* |---------------------------------------------------------------------------------------|
* |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD| NO |RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| TRNS | TRNS |
* |---------------------------------------------------------------------------------------|
* | TRNS | TRNS | TRNS | TRNS | NO | F7 | F8 | F9 | F10 | F11 | F12 |
* |---------------------------------------------------------------------------------------|
*/
[3] ={
{RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6},
{RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_NO, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}
} }
}; };
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
@ -31,13 +74,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
return MACRO_NONE; return MACRO_NONE;
}; };
void matrix_init_user(void) { void matrix_init_user(void) {
} }
void matrix_scan_user(void) { void matrix_scan_user(void) {
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
@ -46,4 +86,34 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void led_set_user(uint8_t usb_led) { void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
} }

@ -0,0 +1,21 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

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

@ -0,0 +1,181 @@
#include "miuni32.h"
// Keyboard layer definitions
#define BASE 0
#define NUMBERS 1
#define SYMBOLS 2
#define MEDIA 3
// Keyboard macro defintions
#define GIT_ST M(0)
#define GIT_PU M(1)
#define GIT_CM M(2)
#define HM_DIR M(3)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Level 0: Default Layer
* ,---------------------------------------------------------------------------------------.
* | Q | W | E | R | T | Y | U | I | O | P | BSP |
* |---------------------------------------------------------------------------------------|
* | A | S | D | F | G | H | J | K | L | ENT | RSFT |
* |---------------------------------------------------------------------------------------|
* |LT(2|Z)|LT(3|X)| C | V | B | SPC | N | M | , |LT(1|.)| RCTL |
* |---------------------------------------------------------------------------------------|
*/
[BASE] ={
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_RSFT},
{LT(2, KC_Z), LT(3, KC_X), KC_C, KC_V, KC_B, KC_SPC, KC_N, KC_M, KC_COMMA, LT(1, KC_DOT), KC_RCTL}
},
/* Level 1: Numbers Layer
* ,---------------------------------------------------------------------------------------.
* | ESC | 7 | 8 | 9 | / | * | . | , | ( | ) | DEL |
* |---------------------------------------------------------------------------------------|
* | TAB | 4 | 5 | 6 | - | + | HOME | UP | END | INS | PGUP |
* |---------------------------------------------------------------------------------------|
* | LATL | 1 | 2 | 3 | 0 | ENT | LEFT | DOWN | RGHT | !TRNS!| PGDN |
* |---------------------------------------------------------------------------------------|
*/
[NUMBERS] ={
{KC_ESC, KC_7, KC_8, KC_9, KC_SLSH, KC_ASTR, KC_DOT, KC_COMM, KC_LPRN, KC_RPRN, KC_DEL},
{KC_TAB, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, KC_HOME, KC_UP, KC_END, KC_INSERT, KC_PGUP},
{KC_LALT, KC_1, KC_2, KC_3, KC_0, KC_ENT, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_PGDN}
},
/* Level 2: Symbols Layer
* ,---------------------------------------------------------------------------------------.
* | ! | @ | # | $ | % | ^ | & | * | _ | = | ? |
* |---------------------------------------------------------------------------------------|
* | RESET | LSFT | ~ | { | } | \ | | | ; | : | ` | " |
* |---------------------------------------------------------------------------------------|
* | !TRNS!| LCTL | TRNS | [ | ] | TAB | < | > | TRNS | RCTL | TRNS |
* |---------------------------------------------------------------------------------------|
*/
[SYMBOLS] ={
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_EQL, KC_QUES},
{RESET, KC_LSFT, KC_TILD, KC_LCBR, KC_RCBR, KC_BSLS, KC_PIPE, KC_SCLN, KC_COLN, KC_GRV, KC_DQUO},
{KC_TRNS, KC_LCTL, KC_TRNS, KC_LBRC, KC_RBRC, KC_TAB, KC_LABK, KC_RABK, KC_TRNS, KC_RCTL, KC_TRNS}
},
/* Level 3: Media Layer
* ,---------------------------------------------------------------------------------------.
* |RGB_TOG|RGB_HUI|RGB_SAI|RGB_VAI| GIT_CM| CALC | WREF | WFAV | MUTE | VOLD | VOLU |
* |---------------------------------------------------------------------------------------|
* |RGB_MOD|RGB_HUD|RGB_SAD|RGB_VAD| GIT_ST| WHOM | WBAK | WFWD | TRNS | STOP | PLAY |
* |---------------------------------------------------------------------------------------|
* | TRNS | !TRNS!| TRNS | HM_DIR| GIT_PU| MYCM | WSTP | WSCH | MSEL | MPRV | MNXT |
* |---------------------------------------------------------------------------------------|
*/
[MEDIA] ={
{RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, GIT_CM, KC_CALC, KC_WREF, KC_WFAV, KC_MUTE, KC_VOLD, KC_VOLU},
{RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, GIT_ST, KC_WHOM, KC_WBAK, KC_WFWD, KC_TRNS, KC_MSTP, KC_MPLY},
{KC_TRNS, KC_TRNS, KC_TRNS, HM_DIR, GIT_PU, KC_MYCM, KC_WSTP, KC_WSCH, KC_MSEL, KC_MPRV, KC_MNXT}
}
};
void press_and_release_key(uint8_t code)
{
register_code(code);
unregister_code(code);
}
void press_and_release_mod_key(uint8_t mod, uint8_t code)
{
register_code(mod);
register_code(code);
unregister_code(code);
unregister_code(mod);
}
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)
{
return MACRO(T(G), T(I), T(T), T(SPC),
T(S), T(T), T(A), T(T), T(U), T(S), END);
}
break;
case 1:
if (record->event.pressed)
{
return MACRO(T(G), T(I), T(T), T(SPC),
T(P), T(U), T(L), T(L), END);
}
break;
case 2:
if (record->event.pressed)
{
return MACRO(T(G), T(I), T(T), T(SPC),
T(C), T(O), T(M), T(M), T(I), T(T), END);
}
break;
case 3:
if (record->event.pressed)
{
/*press_and_release_key(KC_C);
press_and_release_key(KC_D);
press_and_release_key(KC_SPC);
press_and_release_mod_key(KC_LSFT, KC_GRV);
press_and_release_key(KC_SLSH);
press_and_release_key(KC_Q);
press_and_release_key(KC_M);
press_and_release_key(KC_K);
press_and_release_mod_key(KC_LSFT, KC_MINS);*/
return MACRO(I(0),
T(C), T(D), T(SPC),
D(LSFT), T(GRV), U(LSFT), T(SLSH),
T(Q), T(M), T(K), D(LSFT), T(MINS), U(LSFT),
T(F), T(I), T(R), T(M), T(W), T(A), T(R), T(E), T(SLSH),
T(K), T(E), T(Y), T(B), T(O), T(A), T(R), T(D), T(S), T(SLSH),
T(M), T(I), T(U), T(N), T(I), T(3), T(2), T(SLSH),
T(K), T(E), T(Y), T(M), T(A), T(P), T(S), END);
}
}
return MACRO_NONE;
};
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) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

@ -0,0 +1 @@
# ht_156's keymap for miuni32, using 33 keys

@ -6,10 +6,10 @@
#define KEYMAP( \ #define KEYMAP( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A ) { \ K20, K21, K22, K23, K25, K26, K27, K28, K29, K2A ) { \
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A }, \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A } \ { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A } \
} }
#endif #endif

@ -76,7 +76,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -86,17 +86,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _DV: case _DV:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DV);
} }
break; break;
case _QW: case _QW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_QW);
} }
break; break;
case _CM: case _CM:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); persistent_default_layer_set(1UL<<_CM);
} }
break; break;
} }

@ -80,8 +80,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
} }
}; };
// Set a layer persistantly. // Set a layer persistently.
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

@ -149,7 +149,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -161,7 +161,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;

@ -186,7 +186,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -198,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -207,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -216,7 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -0,0 +1,12 @@
ifndef QUANTUM_DIR
include ../../../../Makefile
endif
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
COMMAND_ENABLE = yes # Commands for debug and configuration
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
TAP_DANCE_ENABLE = yes
AUDIO_ENABLE = no
API_SYSEX_ENABLE = no

@ -0,0 +1,31 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define ONESHOT_TAP_TOGGLE 2
#define ONESHOT_TIMEOUT 500
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 7
#define MOUSEKEY_WHEEL_DELAY 0
#define DM_PLAY DYN_MACRO_PLAY1
#define DM_STRT DYN_REC_START1
#define DM_STOP DYN_REC_STOP
#define OSL_RSE OSL(RSE)
#define OSL_LWR OSL(LWR)
#define OSL_FUN OSL(FUN)
#define OSM_CTL OSM(MOD_LCTL)
#define OSM_ALT OSM(MOD_LALT)
#define OSM_SFT OSM(MOD_LSFT)
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@ -0,0 +1,100 @@
#include "planck.h"
#include "backlight.h"
#include "config.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
enum planck_layers { DEF, LWR, RSE, FUN };
enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE };
enum tap_dance_keys { TD_SCLN };
#include "dynamic_macro.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default
* ,-----------------------------------------------------------------------------------.
* | Q | W | E | R | T | Esc | Bksp | Y | U | I | O | P |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | A | S | D | F | G | Tab | Enter| H | J | K | L | ; |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Z | X | C | V | B | Shift|DmPlay| N | M | , | . | / |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Super| Alt | Fun | Lower| Space | Raise| Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[DEF] = {
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P},
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, TD(TD_SCLN)},
{KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
{OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, KC_SPC, KC_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ! | @ | # | $ | % | | | ^ | & | * | ( | ) |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ~ | | | | | | | _ | + | | { | } |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | " | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Home | PgDn | PgUp | End |
* `-----------------------------------------------------------------------------------'
*/
[LWR] = {
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{S(KC_GRV), _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, S(KC_LBRC), S(KC_RBRC)},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, S(KC_QUOT), S(KC_BSLS)},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | 1 | 2 | 3 | 4 | 5 | | | 6 | 7 | 8 | 9 | 0 |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ` | | | | | | | - | = | | [ | ] |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | ' | \ |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Home | PgDn | PgUp | End |
* `-----------------------------------------------------------------------------------'
*/
[RSE] = {
{KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0},
{KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_BSLS},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
},
/* Function
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | Reset|Delete| F6 | F7 | F8 | F9 | F10 |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | F11 | F12 | F13 | F14 | F15 | | | |MsWhLt|MsWhDn|MsWhUp|MsWhRt|
* |------+------+------+------+------+------|------+------+------+------+------+------|
* |BlTggl|BlStep| | | |DmStrt|DmStop| | |MsBtn1|MsBtn2|MsBtn3|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | |MsLeft|MsDown| MsUp |MsRght|
* `-----------------------------------------------------------------------------------'
*/
[FUN] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10},
{KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R},
{BL_TOGG, BL_STEP, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R}
},
};
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_SCLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, S(KC_SCLN)) // once for semi-colon, twice for colon
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_dynamic_macro(keycode, record)) {
return false;
}
return true;
}
void matrix_init_user(void) {
}

@ -0,0 +1,12 @@
About
------
A simple split qwerty Planck layout that makes use of one-shot modifiers,
one-shot layers, tap-dance keys and dynamic macros.
Layout
-------
![Layout](keyboard-layout.jpg "Keyboard Layout")

@ -88,8 +88,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
} }
}; };
// Set a layer persistantly. // Set a layer persistently.
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

@ -204,7 +204,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -217,7 +217,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
break; break;
return false; return false;
@ -226,7 +226,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
break; break;
return false; return false;
@ -235,7 +235,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
break; break;
return false; return false;

@ -164,7 +164,7 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -176,7 +176,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_workman, false, 0); PLAY_NOTE_ARRAY(tone_workman, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_WORKMAN); persistent_default_layer_set(1UL<<_WORKMAN);
} }
return false; return false;
break; break;
@ -185,7 +185,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -200,7 +200,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
keymap_config.raw = eeconfig_read_keymap(); keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1; keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw); eeconfig_update_keymap(keymap_config.raw);
persistant_default_layer_set(1UL<<_PLOVER); persistent_default_layer_set(1UL<<_PLOVER);
} }
return false; return false;
break; break;

@ -270,7 +270,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

@ -6,7 +6,7 @@ needed, they will be mapped to home row keys. The `keymap.c` file will contain
the exact changes. The diagrams in this README shows the highlights of the the exact changes. The diagrams in this README shows the highlights of the
changes from the default mappings. changes from the default mappings.
I also decided to change all calls to `persistant_default_layer_set()` to I also decided to change all calls to `persistent_default_layer_set()` to
`default_layer_set()` since this is my personal perference. `default_layer_set()` since this is my personal perference.
## Macros ## Macros

@ -183,7 +183,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -195,7 +195,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_workman, false, 0); PLAY_NOTE_ARRAY(tone_workman, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_WORKMAN); persistent_default_layer_set(1UL<<_WORKMAN);
} }
return false; return false;
break; break;
@ -212,7 +212,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;

@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* number of backlight levels */ /* number of backlight levels */
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define BACKLIGHT_BREATHING
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5 #define DEBOUNCING_DELAY 5

@ -37,6 +37,14 @@ enum planck_keycodes {
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define MACRO_BREATH_TOGGLE 21
#define MACRO_BREATH_SPEED_INC 23
#define MACRO_BREATH_SPEED_DEC 24
#define MACRO_BREATH_DEFAULT 25
#define M_BRTOG M(MACRO_BREATH_TOGGLE)
#define M_BRINC M(MACRO_BREATH_SPEED_INC)
#define M_BRDEC M(MACRO_BREATH_SPEED_DEC)
#define M_BRDFT M(MACRO_BREATH_DEFAULT)
// Tap Dance Declarations // Tap Dance Declarations
enum { enum {
ESC_CAP = 0, ESC_CAP = 0,
@ -173,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = { [_ADJUST] = {
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, M_BRDFT, KC_DEL },
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, M_BRINC, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, M_BRDEC, C_A_INS},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_A_INS, C_A_DEL} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_BRTOG, C_A_DEL}
} }
@ -205,11 +213,37 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(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 MACRO_BREATH_TOGGLE:
if (record->event.pressed) {
breathing_toggle();
}
break;
case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) {
breathing_speed_inc(1);
}
break;
case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) {
breathing_speed_dec(1);
}
break;
case MACRO_BREATH_DEFAULT:
if (record->event.pressed) {
breathing_defaults();
}
break;
}
return MACRO_NONE;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
@ -217,7 +251,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -226,7 +260,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -235,7 +269,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -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 = 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 = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,8 @@
#ifndef LAE3_KEYMAP_H
#define LAE3_KEYMAP_H
#include "../../config.h"
#define PREVENT_STUCK_MODIFIERS
#endif

@ -0,0 +1,262 @@
#include "planck.h"
#include "action_layer.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#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 planck_layers {
_QWERTY,
_ARROW,
_NUMPAD,
_MOVEMENT,
_LOWER,
_RAISE,
_ADJUST
};
#define _MV _MOVEMENT
enum planck_keycodes {
QWERTY = SAFE_RANGE,
ARROW,
NUMPAD,
LOWER,
RAISE,
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define KC_MUP KC_MS_UP
#define KC_MDN KC_MS_DOWN
#define KC_MLFT KC_MS_LEFT
#define KC_MRGT KC_MS_RIGHT
#define KC_MB1 KC_MS_BTN1
#define KC_MB2 KC_MS_BTN2
#define KC_MB3 KC_MS_BTN3
#define KC_MB4 KC_MS_BTN4
#define KC_MB5 KC_MS_BTN5
#define KC_MWUP KC_MS_WH_UP
#define KC_MWDN KC_MS_WH_DOWN
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
{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_LCTL, KC_LGUI, KC_LALT, MO(_MV), LOWER, KC_SPC, KC_SPC, RAISE, MO(_MV), KC_RALT, KC_RGUI, KC_RCTL}
},
/* Arrow
* ,-----------------------------------------------------------------------------------.
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | Up | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | Left | Down | Right|
* `-----------------------------------------------------------------------------------'
*/
[_ARROW] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT}
},
/* Numpad
* ,-----------------------------------------------------------------------------------.
* | | | | | | |NumLck| 7 | 8 | 9 | / | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | |Enter | 4 | 5 | 6 | * | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | 3 | 2 | 1 | - | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | 0 | . | + | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = {
{_______, _______, _______, _______, _______, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______},
{_______, _______, _______, _______, _______, _______, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PAST, _______},
{_______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PPLS, _______}
},
/* Movement
* ,-----------------------------------------------------------------------------------.
* | |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_MOVEMENT] = {
{_______, KC_MB2, KC_MUP, KC_MB1, KC_MWUP, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______},
{_______, KC_MLFT, KC_MDN, KC_MRGT, KC_MWDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_DEL, KC_END, KC_PGDN, _______},
{KC_CAPS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, XXXXXXX, _______},
{_______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Caps | ^ | & | * | ( | ) | { | } | | | " | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F9 | F10 | F11 | F12 | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_INS, KC_HOME, KC_PGUP, _______},
{KC_CAPS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, XXXXXXX, _______},
{_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* |Reset | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, BL_STEP, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, QWERTY, ARROW, NUMPAD, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
} else {
layer_off(_LOWER);
}
update_tri_layer(_LOWER, _RAISE, _ADJUST);
return false;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
} else {
layer_off(_RAISE);
}
update_tri_layer(_LOWER, _RAISE, _ADJUST);
return false;
case QWERTY:
if (record->event.pressed) {
layer_off(_ARROW);
layer_off(_NUMPAD);
}
return false;
case ARROW:
if (record->event.pressed) {
layer_off(_NUMPAD);
layer_on(_ARROW);
}
return false;
case NUMPAD:
if (record->event.pressed) {
layer_off(_ARROW);
layer_on(_NUMPAD);
}
return false;
}
return true;
}
void matrix_init_user(void)
{
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(100); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

@ -0,0 +1,111 @@
# Lae3
_Keymap based around mode-switching for extended functionality_
## Base Layout
┌-----------------------------------------------------------------------------------┐
| Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
|------+------+------+------+------+------+------+------+------+------+------+------|
|Shift | Z | X | C | V | B | N | M | , | . | / |Shift |
|------+------+------+------+------+-------------+------+------+------+------+------|
| Ctrl | GUI | Alt | Move |Lower | Space |Raise | Move | Alt | GUI | Ctrl |
└-----------------------------------------------------------------------------------┘
This is more similar to a standard keyboard layout than the standard planck
layout, but I have found that this is better for programming, especially for
editor shortcuts.
## Lower Layer
┌-----------------------------------------------------------------------------------┐
| ` | 1 | 2 | 3 | 4 | 5 | - | = | Del | End | PgDn | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Caps | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ' | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | F1 | F2 | F3 | F4 | | | F5 | F6 | F7 | F8 | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
All the numbers are on one hand so that they can all be easily accessed when
playing games. The punctuation was placed in a way that is as similar as
possible the qwerty punctuation layout on a standard keyboard.
## Raise Layer
┌-----------------------------------------------------------------------------------┐
| ~ | ! | @ | # | $ | % | _ | + | Ins | Home | PgUp | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Caps | ^ | & | * | ( | ) | { | } | | | " | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | F9 | F10 | F11 | F12 | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
This layer with the exception of the function and control keys is effectively
the lower layer in combination with the shift key, like on the standard planck
layout.
## Movement Layer
┌-----------------------------------------------------------------------------------┐
| |MsBut2|Ms Up |MsBut1|MsWhUp| | Home | PgDn | PgUp | End | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| |Ms Lft|Ms Dn |Ms Rgt|MsWhDn| | Left | Down | Up | Right| | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
Layer for simplifying movement.
## Meta Layer
┌-----------------------------------------------------------------------------------┐
|Reset | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| |Bcklgt| Mute |Vol Dn|Vol Up| | |Qwerty|Arrow |Numpad| | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | | | |
└-----------------------------------------------------------------------------------┘
This Layer is activated when pressing both the Lower and Raise keys. The Arrow
and Numpad keys each activate a layer between the base layer and the Movement
layer. The Qwerty key disables both of the layers leaving just the base layer
active.
## Arrow Layer
┌-----------------------------------------------------------------------------------┐
| | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | Up | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | | Left | Down | Right|
└-----------------------------------------------------------------------------------┘
Replaces the bottom right of the keyboard with arrow keys for games like The
Binding of Isaac.
## Numpad Layer
┌-----------------------------------------------------------------------------------┐
| | | | | | |NumLck| 7 | 8 | 9 | / | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | |Enter | 4 | 5 | 6 | * | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | 3 | 2 | 1 | - | |
|------+------+------+------+------+-------------+------+------+------+------+------|
| | | | | | | | 0 | . | + | |
└-----------------------------------------------------------------------------------┘
Replaces the majority of the right side of the keyboard with a numpad because
why not?

@ -153,9 +153,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case 1: // M(1) case 1: // M(1)
if (record->event.pressed) { if (record->event.pressed) {
unregister_code(KC_LSFT); unregister_code(KC_LSFT);
register_code(DE_MORE); register_code(DE_LESS);
} else { } else {
unregister_code(DE_MORE); unregister_code(DE_LESS);
} }
break; break;
} }

@ -143,7 +143,7 @@ float goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -156,7 +156,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
break; break;
case _COLEMAK: case _COLEMAK:
@ -164,7 +164,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
break; break;
case _DVORAK: case _DVORAK:
@ -172,7 +172,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
break; break;
case _LOWER: case _LOWER:

@ -100,7 +100,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -112,7 +112,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -121,7 +121,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -130,7 +130,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -27,7 +27,8 @@
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
tp1, tp2, tp3 \
) \ ) \
{ \ { \
{k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \ {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \

@ -233,7 +233,7 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif /* AUDIO_ENABLE */ #endif /* AUDIO_ENABLE */
void persistant_default_layer_set(uint16_t default_layer) void persistent_default_layer_set(uint16_t default_layer)
{ {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
@ -344,7 +344,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_QWERTY: case MACRO_QWERTY:
if (record->event.pressed) if (record->event.pressed)
{ {
persistant_default_layer_set(1UL<<LAYER_QWERTY); persistent_default_layer_set(1UL<<LAYER_QWERTY);
} }
break; break;

@ -139,7 +139,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -151,7 +151,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -160,7 +160,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;

@ -162,7 +162,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -174,7 +174,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -183,7 +183,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -192,7 +192,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -183,7 +183,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -195,7 +195,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -204,7 +204,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -213,7 +213,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -209,7 +209,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -222,7 +222,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
break; break;
case _COLEMAK: case _COLEMAK:
@ -230,7 +230,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
break; break;
case _DVORAK: case _DVORAK:
@ -238,7 +238,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
break; break;
case _LOWER: case _LOWER:

@ -107,7 +107,8 @@ const uint16_t PROGMEM fn_actions[] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint16_t key_timer; static uint16_t key_timer;
if (!process_record_dynamic_macro(keycode, record)) { uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
if (!process_record_dynamic_macro(macro_kc, record)) {
return false; return false;
} }

@ -159,7 +159,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -171,7 +171,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -180,7 +180,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -16,7 +16,7 @@ void tap(uint16_t keycode){
unregister_code(keycode); unregister_code(keycode);
}; };
void persistant_default_layer_set(uint16_t default_layer){ void persistent_default_layer_set(uint16_t default_layer){
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
}; };
@ -200,7 +200,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case COLEMAK: case COLEMAK:
if(record->event.pressed){ if(record->event.pressed){
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
@ -209,7 +209,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
case SWCOLE: case SWCOLE:
if(record->event.pressed){ if(record->event.pressed){
persistant_default_layer_set(1UL<<_SWCOLE); persistent_default_layer_set(1UL<<_SWCOLE);
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_swcole, false, 0); PLAY_NOTE_ARRAY(tone_swcole, false, 0);
#endif #endif

@ -134,7 +134,7 @@ void matrix_init_user(void) {
#endif #endif
} }
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -146,7 +146,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
break; break;
case GAME: case GAME:
@ -154,7 +154,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_game, false, STACCATO); PLAY_NOTE_ARRAY(tone_game, false, STACCATO);
#endif #endif
persistant_default_layer_set(1UL<<_GAME); persistent_default_layer_set(1UL<<_GAME);
} }
break; break;
case RAISE: case RAISE:

@ -212,10 +212,10 @@ const uint16_t PROGMEM fn_actions[] = {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
float start_up[][2] = { float start_up[][2] = {
{440.0*pow(2.0,(14)/12.0), 20}, MUSICAL_NOTE(_B5, 20),
{440.0*pow(2.0,(26)/12.0), 8}, MUSICAL_NOTE(_B6, 8),
{440.0*pow(2.0,(18)/12.0), 20}, MUSICAL_NOTE(_DS6, 20),
{440.0*pow(2.0,(26)/12.0), 8} MUSICAL_NOTE(_B6, 8),
}; };
float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_qwerty[][2] = SONG(QWERTY_SOUND);
@ -225,7 +225,7 @@ float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float goodbye[][2] = SONG(GOODBYE_SOUND); float goodbye[][2] = SONG(GOODBYE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -238,7 +238,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
break; break;
case _COLEMAK: case _COLEMAK:
@ -246,7 +246,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
break; break;
case _DVORAK: case _DVORAK:
@ -254,7 +254,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
break; break;
case _GAME: case _GAME:
@ -262,7 +262,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_GAME); persistent_default_layer_set(1UL<<_GAME);
} }
break; break;
case _NUMPAD: case _NUMPAD:
@ -270,7 +270,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_NUMPAD); persistent_default_layer_set(1UL<<_NUMPAD);
} }
break; break;
case _ARROW: case _ARROW:
@ -278,7 +278,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_LOWER); persistent_default_layer_set(1UL<<_LOWER);
} }
break; break;
case _LOWER: case _LOWER:
@ -323,7 +323,7 @@ void matrix_init_user(void) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
void play_goodbye_tone() void play_goodbye_tone(void)
{ {
PLAY_NOTE_ARRAY(goodbye, false, 0); PLAY_NOTE_ARRAY(goodbye, false, 0);
_delay_ms(150); _delay_ms(150);

@ -180,7 +180,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -192,7 +192,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -201,7 +201,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -210,7 +210,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -196,7 +196,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -205,7 +205,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -231,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
case MQWERTY: case MQWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_MQWERTY); persistent_default_layer_set(1UL<<_MQWERTY);
} }
return false; return false;
break; break;

@ -82,7 +82,7 @@ float tone_startup[][2] = {
float tone_goodbye[][2] = SONG(GOODBYE_SOUND); float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

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

@ -0,0 +1,29 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
#endif

@ -0,0 +1,221 @@
#include "preonic.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
// 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 preonic_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_ADJUST
};
enum preonic_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
BACKLIT
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | CTRL | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Lower| Z | X | C | V | B | N | M | , | . | / |Raise |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |BKSP |SHIFT |ENTER |SPC | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_DEL},
{KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{LOWER , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RAISE },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, KC_LSFT, KC_ENT, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = {
{NOTE_B5, 20},
{NOTE_B6, 8},
{NOTE_DS6, 20},
{NOTE_B6, 8}
};
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
}
return true;
};
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's

@ -183,7 +183,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -195,7 +195,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -204,7 +204,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -213,7 +213,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -177,7 +177,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -198,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -207,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -16,7 +16,7 @@ void tap(uint16_t keycode){
unregister_code(keycode); unregister_code(keycode);
}; };
void persistant_default_layer_set(uint16_t default_layer){ void persistent_default_layer_set(uint16_t default_layer){
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
}; };
@ -200,7 +200,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case COLEMAK: case COLEMAK:
if(record->event.pressed){ if(record->event.pressed){
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
@ -209,7 +209,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
case SWCOLE: case SWCOLE:
if(record->event.pressed){ if(record->event.pressed){
persistant_default_layer_set(1UL<<_SWCOLE); persistent_default_layer_set(1UL<<_SWCOLE);
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_swcole, false, 0); PLAY_NOTE_ARRAY(tone_swcole, false, 0);
#endif #endif

@ -18,14 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ps2avrGB.h" #include "ps2avrGB.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP( \ KC_KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END, \ ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL, \ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS,
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,\ CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\ LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,
LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT \ LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT
), )
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {

@ -28,6 +28,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \ K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \ K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \ K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
){ \
{ K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KE0 }, \
{ K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \
{ K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \
{ K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \
{ K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
{ K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \
{ K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
{ K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \
}
#define KC_KEYMAP( \
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
) \ ) \
{ \ { \
{ KC_##K00, KC_##K10, KC_##K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \ { KC_##K00, KC_##K10, KC_##K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \

@ -31,7 +31,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -41,7 +41,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _NP: case _NP:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_NP); persistent_default_layer_set(1UL<<_NP);
} }
break; break;
} }

@ -38,7 +38,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -48,12 +48,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _L1: case _L1:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_L1); persistent_default_layer_set(1UL<<_L1);
} }
break; break;
case _NP: case _NP:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_NP); persistent_default_layer_set(1UL<<_NP);
} }
break; break;
} }

@ -0,0 +1,5 @@
SUBPROJECT_DEFAULT = default
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

@ -0,0 +1,59 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2016 Julien Pecqueur <julien@peclu.net>
Copyright 2016 Felix Uhl <ifreilicht@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 Massdrop
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/* number of backlight levels */
#define BACKLIGHT_PIN B7
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 3
#endif
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 5
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
#ifdef SUBPROJECT_default
#include "default/config.h"
#endif
#ifdef SUBPROJECT_rgb
#include "rgb/config.h"
#endif
#endif

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

@ -0,0 +1,25 @@
#ifndef DEFAULT_CONFIG_H
#define DEFAULT_CONFIG_H
#include "../config.h"
#define PRODUCT S60-X
#define DESCRIPTION q.m.k. keyboard firmware for S60-X
#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 }
#define UNUSED_PINS { F0 }
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE
/* key combination for magic key command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
#endif

@ -1,4 +1,4 @@
#include "s60-x.h" #include "default.h"
void matrix_init_kb(void) { void matrix_init_kb(void) {
// put your keyboard start-up code here // put your keyboard start-up code here

@ -1,6 +1,6 @@
/* /*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com> Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
Copyright 2015 Vinícius Nery Cordeiro <vinicius.nery.cordeiro@gmail.com> Copyright 2015 Vin<EFBFBD>cius Nery Cordeiro <vinicius.nery.cordeiro@gmail.com>
Copyright 2016 Felix Uhl <ifreilicht@gmail.com> Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -17,14 +17,14 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef S60X_H #ifndef DEFAULT_H
#define S60X_H #define DEFAULT_H
#include "quantum.h" #include "quantum.h"
#ifdef __INTELLISENSE__ #ifdef __INTELLISENSE__
#define PROGMEM #define PROGMEM
#include "config.h" #include "../config.h"
#endif #endif
/* S60-X keymap definition macro /* S60-X keymap definition macro

@ -0,0 +1,9 @@
CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE ?= no
ifndef QUANTUM_DIR
include ../../../Makefile
endif

@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "s60-x.h" #include "s60_x.h"
//make keymap a little easier to read //make keymap a little easier to read
#define _______ KC_TRNS #define _______ KC_TRNS

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* Main layer: Test layout, using all keys. /* Main layer: Test layout, using all keys.

@ -0,0 +1,205 @@
#include "s60_x.h"
#define _DEFAULT 0
#define _FN 1
#define _SFX 2
// Fillers to make layering more clear
#define ______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty gui/alt/space/alt/gui
* ,-----------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
* |-----------------------------------------------------------------------------------------+
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
* |-----------------------------------------------------------------------------------------+
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
* |-----------------------------------------------------------------------------------------+
* | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
* |-----------------------------------------------------------------------------------------+
* |LGUI | LAlt | Space | RAlt |RGUI |
* `-----------------------------------------------------------------'
*/
[_DEFAULT] = 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_BSLS, KC_GRV, \
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_BSPC, \
KC_LCTL, 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_LSFT, ______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ______, KC_RSFT, MO(_FN), \
______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \
),
/* FN Layer
* ,-----------------------------------------------------------------------------------------.
* | SFX | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
* |-----------------------------------------------------------------------------------------+
* | CAPS | | | | | | | | Psc | Slck| Paus| Up | | |
* |-----------------------------------------------------------------------------------------+
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
* |-----------------------------------------------------------------------------------------+
* | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
* |-----------------------------------------------------------------------------------------+
* | | | | Stop | |
* `-----------------------------------------------------------------'
*/
[_FN] = KEYMAP( /* Layer 1 */
TG(_SFX),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_INS, KC_DEL, \
KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, ______, \
______, ______, KC_MPRV, KC_MPLY, KC_MNXT,______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN,______, ______, ______, \
______, ______, ______, ______, KC_MSTP, ______, ______, ______ \
),
/* SFX Layer
* ,-----------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------------------------------------+
* | | BL- | BL+ | BL | | | | | | | | | | |
* |-----------------------------------------------------------------------------------------+
* | | RGBT| RGBM| | | | | | | | | | |
* |-----------------------------------------------------------------------------------------+
* | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | |
* |-----------------------------------------------------------------------------------------+
* | | | | | |
* `-----------------------------------------------------------------'
*/
[_SFX] = KEYMAP(
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, BL_TOGG,BL_STEP,BL_DEC, BL_INC, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______ \
)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE;
}
enum function_id {
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(RGBLED_TOGGLE),
[1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL)
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {
case RGBLED_TOGGLE:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_toggle();
#endif
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_increase_hue();
#endif
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_decrease_hue();
#endif
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_increase_sat();
#endif
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_decrease_sat();
#endif
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_increase_val();
#endif
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_decrease_val();
#endif
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
#ifdef RGB_ENABLE
rgblight_step();
#endif
}
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) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* 0: Main layer /* 0: Main layer

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* /*
* Hasu * Hasu

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* /*
* HHKB Layout * HHKB Layout

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* 0: Main layer /* 0: Main layer

@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "s60-x.h" #include "s60_x.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layout 0: Default Layer /* Layout 0: Default Layer

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* Main layer: /* Main layer:

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty /* 0: qwerty

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
// Poker fix with toggle and bit operation // Poker fix with toggle and bit operation
// Fn + Esc = ` // Fn + Esc = `

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
// Poker fix with set(state transition) // Poker fix with set(state transition)
// Fn + Esc = ` // Fn + Esc = `

@ -1,4 +1,4 @@
#include "s60-x.h" #include "s60_x.h"
/* /*
* SpaceFN * SpaceFN

@ -5,11 +5,6 @@ DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps
## S60X Resources ## S60X Resources
- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) - [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open)
## Quickstart
If you just want to test a few layouts, the archive [s60-x_precompiled.zip](s60-x_precompiled.zip) contains pre-compiled .hex-files for all available keymaps. Not all of them are tested.
You only need to flash them onto your keyboard, which is explained below, there's no need to setup a build environment. For a full list
## Flashing your keyboard ## Flashing your keyboard
The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows). The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows).

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

@ -0,0 +1,32 @@
#ifndef RBG_CONFIG_H
#define RBG_CONFIG_H
#include "../config.h"
#define PRODUCT S60-X-RGB
#define DESCRIPTION q.m.k. keyboard firmware for S60-X RGB
/* key matrix pins */
#define MATRIX_ROW_PINS { B5, B4, D7, D6, D4 }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, B6, C6, C7, F1, F0, E6, B3, B2, B1, B0 }
#define UNUSED_PINS
/* 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
/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
#define RGB_DI_PIN F6
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 10
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
#endif

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

@ -0,0 +1,37 @@
#ifndef S60XRGB_H
#define S60XRGB_H
#include "quantum.h"
#define KEYMAP( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \
K400, K401, K402, K406, K410, K411, K412, K413 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \
{ K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \
}
/*This special definition is used for S60-X keymaps that were ported from TMK
* QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended
*/
#define LEGACY_KEYMAP( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
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, K3E, \
K40, K41, K42, K46, K4A, K4B, K4C, K4D \
) { \
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO }, \
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \
{ KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \
}
#endif

@ -0,0 +1,9 @@
CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE ?= yes # Enable RGB light
ifndef QUANTUM_DIR
include ../../../Makefile
endif

@ -0,0 +1,65 @@
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# 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)
# 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
MIDI_ENABLE ?= no # MIDI controls
UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6

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

@ -0,0 +1,13 @@
#ifndef S60X_H
#define S60X_H
#ifdef SUBPROJECT_default
#include "default.h"
#endif
#ifdef SUBPROJECT_rgb
#include "rgb.h"
#endif
#include "quantum.h"
#endif

@ -0,0 +1,21 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = 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.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,98 @@
#include "satan.h"
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// 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 _BL 0
#define _FL 1
#define _______ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-----------------------------------------------------------.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
* |-----------------------------------------------------------|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl |
* `-----------------------------------------------------------'
*/
[_BL] = KEYMAP_ANSI(
F(0), 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_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, \
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, MO(_FL), KC_LGUI, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL),
/* Keymap _FL: Function Layer
* ,-----------------------------------------------------------.
* | | | | | | | | | | | | | | RESET|
* |-----------------------------------------------------------|
* | | | | | | | | | | | |BL-|BL+|BL |
* |--------------------------------------------ΩΩ---------------|
* | | | | | | | | | | | | |
* |-----------------------------------------------------------|
* | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | |
* |-----------------------------------------------------------|
* | | | | | | | | |
* `-----------------------------------------------------------'
*/
[_FL] = KEYMAP_ANSI(
#ifdef RGBLIGHT_ENABLE
KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
_______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______, \
_______,_______,_______, _______, _______,_______,_______, _______),
#else
KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \
_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP, KC_END, BL_DEC, BL_INC,BL_TOGG, \
KC_DEL, KC_VOLD,KC_MUTE,KC_VOLU,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,_______,_______, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
_______,_______,_______, _______, _______,_______,_______,_______),
#endif
};
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

@ -0,0 +1 @@
# Colemak layout for GH60 Satan

@ -111,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
) )
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -120,19 +120,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -177,7 +177,7 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif #endif
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0); PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
@ -198,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0); PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
@ -207,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0); PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif #endif
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

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

@ -1,7 +1,5 @@
/* /*
Copyright 2012 Jun Wako <wakojun@gmail.com> Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2016 Julien Pecqueur <julien@peclu.net>
Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -26,44 +24,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VENDOR_ID 0xFEED #define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060 #define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER Massdrop #define MANUFACTURER Bathroom Epiphanies
#define PRODUCT S60-X #define PRODUCT tiger_lily
#define DESCRIPTION q.m.k. keyboard firmware for S60-X #define DESCRIPTION Tiger Lily controller for the Filco Majestouch 2
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/* /*
* Keyboard Matrix Assignments * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies
* * Ported from the Bathroom Epiphanies TMK Firmware:
* Change this to how you wired your keyboard * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers
* 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 { B7, B3, B2, B1, B0 }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 }
#define UNUSED_PINS { F0 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
// #define BACKLIGHT_PIN B7 /* key matrix size */
// #define BACKLIGHT_BREATHING #define MATRIX_ROWS 8 // Row0 - Row7 in the schematic
// #define BACKLIGHT_LEVELS 3 #define MATRIX_COLS 18 // ColA - ColR in the schematic
/*
* Keyboard Matrix Assignments
*/
#define UNUSED_PINS { B0, C4, D3 }
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 5 #define DEBOUNCING_DELAY 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE #define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */ /* Locking resynchronize hack */
@ -157,8 +140,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* disable action features */ /* disable action features */
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING //#define NO_ACTION_TAPPING
#define NO_ACTION_ONESHOT //#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
#endif #endif

@ -0,0 +1,21 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,11 @@
#include "tiger_lily.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(\
KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
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, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
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_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \
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_P4, KC_P5, KC_P6, \
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT)
};

@ -0,0 +1 @@
# The default keymap for tiger_lily

@ -0,0 +1,137 @@
/*
Copyright 2017 Gabriel Young <gabeplaysdrums@live.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 <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#ifndef DEBOUNCING_DELAY
# define DEBOUNCING_DELAY 5
#endif
static uint8_t debouncing = DEBOUNCING_DELAY;
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static matrix_row_t scan_col(void) {
return (
(PINC&(1<<2) ? 0 : ((matrix_row_t)1<<0)) | \
(PINB&(1<<3) ? 0 : ((matrix_row_t)1<<1)) | \
(PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | \
(PINB&(1<<2) ? 0 : ((matrix_row_t)1<<3)) | \
(PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | \
(PINC&(1<<7) ? 0 : ((matrix_row_t)1<<5)) | \
(PINB&(1<<6) ? 0 : ((matrix_row_t)1<<6)) | \
(PINB&(1<<5) ? 0 : ((matrix_row_t)1<<7))
);
}
static void select_col(uint8_t col) {
switch (col) {
case 0: PORTD = (PORTD & ~0b01110111) | 0b01110110; break; \
case 1: PORTD = (PORTD & ~0b01110111) | 0b01100001; break; \
case 2: PORTD = (PORTD & ~0b01110111) | 0b01100101; break; \
case 3: PORTD = (PORTD & ~0b01110111) | 0b00000011; break; \
case 4: PORTD = (PORTD & ~0b01110111) | 0b00000111; break; \
case 5: PORTD = (PORTD & ~0b01110111) | 0b00010011; break; \
case 6: PORTD = (PORTD & ~0b01110111) | 0b00010111; break; \
case 7: PORTD = (PORTD & ~0b01110111) | 0b00100011; break; \
case 8: PORTD = (PORTD & ~0b01110111) | 0b00100111; break; \
case 9: PORTD = (PORTD & ~0b01110111) | 0b00110011; break; \
case 10: PORTD = (PORTD & ~0b01110111) | 0b01110010; break; \
case 11: PORTD = (PORTD & ~0b01110111) | 0b01100110; break; \
case 12: PORTD = (PORTD & ~0b01110111) | 0b01110000; break; \
case 13: PORTD = (PORTD & ~0b01110111) | 0b01100100; break; \
case 14: PORTD = (PORTD & ~0b01110111) | 0b01100000; break; \
case 15: PORTD = (PORTD & ~0b01110111) | 0b01000111; break; \
case 16: PORTD = (PORTD & ~0b01110111) | 0b01000011; break; \
case 17: PORTD = (PORTD & ~0b01110111) | 0b00110111; break;
}
}
void matrix_init(void) {
/* Column output pins */ \
DDRD |= 0b01110111; \
/* Row input pins */ \
DDRC &= ~0b10000100; \
DDRB &= ~0b01111110; \
PORTC |= 0b10000100; \
PORTB |= 0b01111110;
for (uint8_t i=0; i < MATRIX_ROWS; i++)
matrix[i] = matrix_debouncing[i] = 0;
matrix_init_quantum();
}
uint8_t matrix_scan(void) {
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
select_col(col);
_delay_us(3);
matrix_row_t col_scan = scan_col();
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col);
bool curr_bit = col_scan & (1<<row);
if (prev_bit != curr_bit) {
matrix_debouncing[row] ^= ((matrix_row_t)1<<col);
debouncing = DEBOUNCING_DELAY;
}
}
}
if (debouncing) {
if (--debouncing)
_delay_ms(1);
else
for (uint8_t i = 0; i < MATRIX_ROWS; i++)
matrix[i] = matrix_debouncing[i];
}
matrix_scan_quantum();
return 1;
}
inline matrix_row_t matrix_get_row(uint8_t row) {
return matrix[row];
}
void matrix_print(void) {
#ifndef NO_PRINT
print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_row_t matrix_row = matrix_get_row(row);
xprintf("%02X: ", row);
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
bool curr_bit = matrix_row & (1<<col);
xprintf("%c", curr_bit ? '*' : '.');
}
print("\n");
}
#endif
}
uint8_t matrix_key_count(void) {
uint8_t count = 0;
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
count += bitpop32(matrix[row]);
return count;
}

@ -0,0 +1,32 @@
tiger_lily keyboard firmware
======================
This is the firmware for Rev. 20161114 of the Tiger Lily controller by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), a replacement controller for the [Filco Majestouch 2 104 key](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1819). Bathroom Epiphanies has advised that the source is also compatible with the Black Petal controller, however I do not own an example to test against.
The code was adapted from the [BathroomEpiphanies TMK Firmware](https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers).
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme](/).
## Building
Download or clone the whole firmware and navigate to the keyboards/tiger_lily folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
Depending on which keymap you would like to use, you will have to compile slightly differently.
### Default
To build with the default keymap, simply run `make default`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
```
$ make [default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.

@ -1,8 +1,6 @@
# MCU name # MCU name
#MCU = at90usb1287 #MCU = at90usb1287
MCU = atmega32u4 MCU = atmega32u2
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
@ -53,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
@ -67,3 +65,7 @@ MIDI_ENABLE ?= no # MIDI controls
UNICODE_ENABLE ?= no # Unicode UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6 AUDIO_ENABLE ?= no # Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches
CUSTOM_MATRIX = yes
SRC += matrix.c

@ -0,0 +1,63 @@
#include "tiger_lily.h"
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) {
DDRB |= (1<<7);
DDRC |= (1<<5) | (1<<6);
print_dec(usb_led);
if (usb_led & (1<<USB_LED_NUM_LOCK))
PORTC &= ~(1<<5);
else
PORTC |= (1<<5);
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
PORTB &= ~(1<<7);
else
PORTB |= (1<<7);
if (usb_led & (1<<USB_LED_CAPS_LOCK))
PORTC &= ~(1<<6);
else
PORTC |= (1<<6);
led_set_user(usb_led);
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
__attribute__ ((weak))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
__attribute__ ((weak))
void led_set_user(uint8_t usb_led) {
}

@ -0,0 +1,50 @@
#ifndef TIGER_LILY_H
#define TIGER_LILY_H
#include "quantum.h"
// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
/*
Matrix col/row mapping
,----. ,-------------------. ,-------------------. ,-------------------. ,--------------.
| J6 | | I4 | H4 | H2 | H6 | | A7 | E6 | D2 | D4 | | B4 | B7 | B6 | B0 | | C7 | C5 | A5 |
`----' `-------------------' `-------------------' `-------------------' `--------------'
,-------------------------------------------------------------------------. ,--------------. ,-------------------.
| J4 | J7 | I7 | H7 | G7 | G4 | F4 | F7 | E7 | D7 | R7 | R4 | E4 | B2 | | L4 | O4 | Q4 | | K1 | L1 | Q1 | Q0 |
|-------------------------------------------------------------------------| |--------------| |-------------------|
| J2 | J5 | I5 | H5 | G5 | G2 | F2 | F5 | E5 | D5 | R5 | R2 | E2 | B3 | | K4 | O7 | Q7 | | K5 | L5 | Q5 | O5 |
|-------------------------------------------------------------------------| '--------------' |-------------- |
| O5 | J3 | I3 | H3 | G3 | G6 | F6 | F3 | E3 | D3 | R3 | R6 | B1 | | K2 | L2 | Q2 | |
|-------------------------------------------------------------------------| ,----. |-------------------|
| N2 | J1 | I1 | H1 | G1 | G0 | F0 | F1 | E1 | D1 | R0 | N3 | | O6 | | K3 | L3 | Q3 | O3 |
|-------------------------------------------------------------------------| ,--------------. |-------------- |
| A4 | P2 | C6 | K6 | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6 | Q6 | |
`-------------------------------------------------------------------------' `--------------' `-------------------'
*/
#define KEYMAP( \
KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, KK5, KL5, KQ5, KO5, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, KK2, KL2, KQ2, \
KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, KK3, KL3, KQ3, KO3, \
KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0, KL6, KQ6 \
) \
{ \
/* Columns and rows need to be swapped in the below definition */ \
/* A B C D E F G H I J K L M N O P Q R */ \
/* 0 */ { KC_NO, KB0, KC0, KD0, KC_NO, KF0, KG0, KC_NO, KC_NO, KC_NO, KK0, KL0, KC_NO, KC_NO, KO0, KC_NO, KQ0, KR0 }, \
/* 1 */ { KA1, KB1, KC_NO, KD1, KE1, KF1, KG1, KH1, KI1, KJ1, KK1, KL1, KC_NO, KC_NO, KC_NO, KC_NO, KQ1, KC_NO }, \
/* 2 */ { KC_NO, KB2, KC_NO, KD2, KE2, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KC_NO, KN2, KC_NO, KP2, KQ2, KR2 }, \
/* 3 */ { KC_NO, KB3, KC_NO, KD3, KE3, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KQ3, KR3 }, \
/* 4 */ { KA4, KB4, KC_NO, KD4, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KC_NO, KC_NO, KO4, KC_NO, KQ4, KR4 }, \
/* 5 */ { KA5, KC_NO, KC5, KD5, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KC_NO, KC_NO, KO5, KC_NO, KQ5, KR5 }, \
/* 6 */ { KC_NO, KB6, KC6, KC_NO, KE6, KF6, KG6, KH6, KI6, KJ6, KK6, KL6, KC_NO, KC_NO, KO6, KC_NO, KQ6, KR6 }, \
/* 7 */ { KA7, KB7, KC7, KD7, KE7, KF7, KG7, KH7, KI7, KJ7, KC_NO, KC_NO, KC_NO, KC_NO, KO7, KC_NO, KQ7, KR7 } \
}
#endif

@ -69,7 +69,7 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -79,17 +79,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
switch(id) { switch(id) {
case _DV: case _DV:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_DV);
} }
break; break;
case _QW: case _QW:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_QW);
} }
break; break;
case _CM: case _CM:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); persistent_default_layer_set(1UL<<_CM);
} }
break; break;
} }

@ -285,7 +285,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ /*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }

@ -8,7 +8,7 @@ needed, they will be mapped to home row keys. The `keymap.c` file will contain
the exact changes. The diagrams in this README shows the highlights of the the exact changes. The diagrams in this README shows the highlights of the
changes from the default mappings. changes from the default mappings.
I also decided to change all calls to `persistant_default_layer_set()` to I also decided to change all calls to `persistent_default_layer_set()` to
`default_layer_set()` since this is my personal perference. `default_layer_set()` since this is my personal perference.
## Macros ## Macros

@ -171,7 +171,7 @@ ALT_T(BACKLIT), _______ , _______ , KC_MPLY , KC_MNXT , _____
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ /*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
@ -180,19 +180,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY); persistent_default_layer_set(1UL<<_QWERTY);
} }
return false; return false;
break; break;
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false; return false;
break; break;
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false; return false;
break; break;

@ -4,16 +4,23 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
#define _DV 0 enum planck_layers {
#define _QW 1 _QWERTY,
#define _CM 2 _COLEMAK,
#define _L1 3 _DVORAK,
#define _L2 4 _LOWER,
_RAISE,
_ADJUST
};
// Macro name shortcuts enum planck_keycodes {
#define DVORAK M(_DV) DVORAK = SAFE_RANGE,
#define QWERTY M(_QW) QWERTY,
#define COLEMAK M(_CM) COLEMAK,
LOWER,
RAISE,
ADJUST
};
// Fillers to make layering more clear // Fillers to make layering more clear
#define _______ KC_TRNS #define _______ KC_TRNS
@ -21,72 +28,94 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* 0: Dvorak */ [_DVORAK] = { /* 0: Dvorak */
{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_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
{MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, LT(_L2, KC_MINS)}, {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
{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_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT},
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_BSLS, KC_EQL, XXXXXXX, KC_ENT } {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
}, },
[_QW] = { /* 1: Qwerty */ [_QWERTY] = { /* 1: Qwerty */
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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_BSPC},
{MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_L2, KC_QUOT)}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, {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_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT } {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
}, },
[_CM] = { /* 2: Colemak */ [_COLEMAK] = { /* 2: Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, 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_BSPC},
{MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, LT(_L2, KC_QUOT)}, {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, {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_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, KC_ENT } {KC_LCTL, KC_LALT, LOWER, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, RAISE, KC_LGUI, XXXXXXX, KC_ENT }
}, },
[_L1] = {/* 1: FN 1 */ [_LOWER] = {/* 1: FN 1 */
{KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE},
{_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, {_______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
{KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_EQL, _______, _______ } {KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
}, },
[_L2] = { /* 2: FN 2 */ [_RAISE] = { /* 2: FN 2 */
{KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS},
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_HOME, KC_PGUP, KC_VOLU, _______ }, {_______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
{QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PLUS, _______, _______ } {KC_LEFT, KC_RGHT, _______, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, _______, KC_UP, XXXXXXX, KC_DOWN}
} },
};
const uint16_t PROGMEM fn_actions[] = {
[_ADJUST] = {
{KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 },
{_______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{KC_HOME, KC_END, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PGUP, XXXXXXX, KC_PGDN}
}
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) bool process_record_user(uint16_t keycode, keyrecord_t *record) {
{ switch (keycode) {
switch(id) { case QWERTY:
case _DV: if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistent_default_layer_set(1UL<<_COLEMAK);
} }
return false;
break; break;
case _QW: case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); persistent_default_layer_set(1UL<<_DVORAK);
} }
return false;
break; break;
case _CM: case LOWER:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false;
break; break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
}
return true;
} }
return MACRO_NONE;
};

@ -299,7 +299,7 @@ float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
#endif /* AUDIO_ENABLE */ #endif /* AUDIO_ENABLE */
void persistant_default_layer_set(uint16_t default_layer) void persistent_default_layer_set(uint16_t default_layer)
{ {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
@ -427,7 +427,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_QWERTY: case MACRO_QWERTY:
if (record->event.pressed) if (record->event.pressed)
{ {
persistant_default_layer_set(1UL<<LAYER_QWERTY); persistent_default_layer_set(1UL<<LAYER_QWERTY);
} }
break; break;

@ -5,8 +5,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer // 0: Base Layer
KEYMAP( KEYMAP(
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_BSLS, KC_GRV, \ 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_GRV, \
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_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_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_RSFT, KC_UP, KC_DEL, \ 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_RSFT, KC_UP, KC_DEL, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),

@ -1,6 +1,6 @@
# QMK Firmware for XIUDI's 60% XD60 PCB # QMK Firmware for XIUDI's 60% XD60 PCB
![Top View of a pair of XD60 Keyboard](./xd60.JPG) ![Top View of a pair of XD60 Keyboard](./xd60.jpg)
## Quantum MK Firmware ## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme.md](/readme.md). For the full Quantum feature list, see [the parent readme.md](/readme.md).

@ -40,6 +40,7 @@
enum dynamic_macro_keycodes { enum dynamic_macro_keycodes {
DYN_REC_START1 = DYNAMIC_MACRO_RANGE, DYN_REC_START1 = DYNAMIC_MACRO_RANGE,
DYN_REC_START2, DYN_REC_START2,
DYN_REC_STOP,
DYN_MACRO_PLAY1, DYN_MACRO_PLAY1,
DYN_MACRO_PLAY2, DYN_MACRO_PLAY2,
}; };
@ -47,11 +48,22 @@ enum dynamic_macro_keycodes {
/* Blink the LEDs to notify the user about some event. */ /* Blink the LEDs to notify the user about some event. */
void dynamic_macro_led_blink(void) void dynamic_macro_led_blink(void)
{ {
#ifdef BACKLIGHT_ENABLE
backlight_toggle(); backlight_toggle();
_delay_ms(100); _delay_ms(100);
backlight_toggle(); backlight_toggle();
#endif
} }
/* Convenience macros used for retrieving the debug info. All of them
* need a `direction` variable accessible at the call site.
*/
#define DYNAMIC_MACRO_CURRENT_SLOT() (direction > 0 ? 1 : 2)
#define DYNAMIC_MACRO_CURRENT_LENGTH(BEGIN, POINTER) \
((int)(direction * ((POINTER) - (BEGIN))))
#define DYNAMIC_MACRO_CURRENT_CAPACITY(BEGIN, END2) \
((int)(direction * ((END2) - (BEGIN)) + 1))
/** /**
* Start recording of the dynamic macro. * Start recording of the dynamic macro.
* *
@ -61,6 +73,8 @@ void dynamic_macro_led_blink(void)
void dynamic_macro_record_start( void dynamic_macro_record_start(
keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) keyrecord_t **macro_pointer, keyrecord_t *macro_buffer)
{ {
dprintln("dynamic macro recording: started");
dynamic_macro_led_blink(); dynamic_macro_led_blink();
clear_keyboard(); clear_keyboard();
@ -78,6 +92,8 @@ void dynamic_macro_record_start(
void dynamic_macro_play( void dynamic_macro_play(
keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction) keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction)
{ {
dprintf("dynamic macro: slot %d playback\n", DYNAMIC_MACRO_CURRENT_SLOT());
uint32_t saved_layer_state = layer_state; uint32_t saved_layer_state = layer_state;
clear_keyboard(); clear_keyboard();
@ -96,35 +112,68 @@ void dynamic_macro_play(
/** /**
* Record a single key in a dynamic macro. * Record a single key in a dynamic macro.
* *
* @param macro_buffer[in] The start of the used macro buffer.
* @param macro_pointer[in,out] The current buffer position. * @param macro_pointer[in,out] The current buffer position.
* @param macro_end2[in] The end of the other macro which shouldn't be overwritten. * @param macro2_end[in] The end of the other macro.
* @param direction[in] Either +1 or -1, which way to iterate the buffer. * @param direction[in] Either +1 or -1, which way to iterate the buffer.
* @param record[in] The current keypress. * @param record[in] The current keypress.
*/ */
void dynamic_macro_record_key( void dynamic_macro_record_key(
keyrecord_t *macro_buffer,
keyrecord_t **macro_pointer, keyrecord_t **macro_pointer,
keyrecord_t *macro_end2, keyrecord_t *macro2_end,
int8_t direction, int8_t direction,
keyrecord_t *record) keyrecord_t *record)
{ {
if (*macro_pointer + direction != macro_end2) { /* If we've just started recording, ignore all the key releases. */
if (!record->event.pressed && *macro_pointer == macro_buffer) {
dprintln("dynamic macro: ignoring a leading key-up event");
return;
}
/* The other end of the other macro is the last buffer element it
* is safe to use before overwriting the other macro.
*/
if (*macro_pointer - direction != macro2_end) {
**macro_pointer = *record; **macro_pointer = *record;
*macro_pointer += direction; *macro_pointer += direction;
} else { } else {
/* Notify about the end of buffer. The blinks are paired dynamic_macro_led_blink();
* because they should happen on both down and up events. */
backlight_toggle();
} }
dprintf(
"dynamic macro: slot %d length: %d/%d\n",
DYNAMIC_MACRO_CURRENT_SLOT(),
DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, *macro_pointer),
DYNAMIC_MACRO_CURRENT_CAPACITY(macro_buffer, macro2_end));
} }
/** /**
* End recording of the dynamic macro. Essentially just update the * End recording of the dynamic macro. Essentially just update the
* pointer to the end of the macro. * pointer to the end of the macro.
*/ */
void dynamic_macro_record_end(keyrecord_t *macro_pointer, keyrecord_t **macro_end) void dynamic_macro_record_end(
keyrecord_t *macro_buffer,
keyrecord_t *macro_pointer,
int8_t direction,
keyrecord_t **macro_end)
{ {
dynamic_macro_led_blink(); dynamic_macro_led_blink();
/* Do not save the keys being held when stopping the recording,
* i.e. the keys used to access the layer DYN_REC_STOP is on.
*/
while (macro_pointer != macro_buffer &&
(macro_pointer - direction)->event.pressed) {
dprintln("dynamic macro: trimming a trailing key-down event");
macro_pointer -= direction;
}
dprintf(
"dynamic macro: slot %d saved, length: %d\n",
DYNAMIC_MACRO_CURRENT_SLOT(),
DYNAMIC_MACRO_CURRENT_LENGTH(macro_buffer, macro_pointer));
*macro_end = macro_pointer; *macro_end = macro_pointer;
} }
@ -152,7 +201,7 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
* &macro_buffer macro_end * &macro_buffer macro_end
* v v * v v
* +------------------------------------------------------------+ * +------------------------------------------------------------+
* |>>>>>> MACRO1 >>>>>>| |<<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<|
* +------------------------------------------------------------+ * +------------------------------------------------------------+
* ^ ^ * ^ ^
* r_macro_end r_macro_buffer * r_macro_end r_macro_buffer
@ -209,18 +258,17 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
} else { } else {
/* A macro is being recorded right now. */ /* A macro is being recorded right now. */
switch (keycode) { switch (keycode) {
case MO(_DYN): case DYN_REC_STOP:
/* Use the layer key used to access the macro recording as /* Stop the macro recording. */
* a stop button. */
if (record->event.pressed) { /* Ignore the initial release if (record->event.pressed) { /* Ignore the initial release
* just after the recoding * just after the recoding
* starts. */ * starts. */
switch (macro_id) { switch (macro_id) {
case 1: case 1:
dynamic_macro_record_end(macro_pointer, &macro_end); dynamic_macro_record_end(macro_buffer, macro_pointer, +1, &macro_end);
break; break;
case 2: case 2:
dynamic_macro_record_end(macro_pointer, &r_macro_end); dynamic_macro_record_end(r_macro_buffer, macro_pointer, -1, &r_macro_end);
break; break;
} }
macro_id = 0; macro_id = 0;
@ -230,10 +278,10 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
/* Store the key in the macro buffer and process it normally. */ /* Store the key in the macro buffer and process it normally. */
switch (macro_id) { switch (macro_id) {
case 1: case 1:
dynamic_macro_record_key(&macro_pointer, r_macro_end, +1, record); dynamic_macro_record_key(macro_buffer, &macro_pointer, r_macro_end, +1, record);
break; break;
case 2: case 2:
dynamic_macro_record_key(&macro_pointer, macro_end, -1, record); dynamic_macro_record_key(r_macro_buffer, &macro_pointer, macro_end, -1, record);
break; break;
} }
return true; return true;
@ -244,4 +292,8 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
return true; return true;
} }
#undef DYNAMIC_MACRO_CURRENT_SLOT
#undef DYNAMIC_MACRO_CURRENT_LENGTH
#undef DYNAMIC_MACRO_CURRENT_CAPACITY
#endif #endif

@ -20,13 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h> #include <stdbool.h>
#include <musical_notes.h> #include <musical_notes.h>
__attribute__ ((weak))
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
__attribute__ ((weak))
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
__attribute__ ((weak))
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
bool fauxclicky_enabled = true; bool fauxclicky_enabled = true;
uint16_t note_start = 0; uint16_t note_start = 0;
bool note_playing = false; bool note_playing = false;
@ -48,13 +41,13 @@ void fauxclicky_stop()
note_playing = false; note_playing = false;
} }
void fauxclicky_play(float note[2]) { void fauxclicky_play(float note[]) {
if (!fauxclicky_enabled) return; if (!fauxclicky_enabled) return;
if (note_playing) fauxclicky_stop(); if (note_playing) fauxclicky_stop();
FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)); FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER));
FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2); FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)) / (float)2);
note_playing = true; note_playing = true;
note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this note_period = (note[1] / (float)16) * ((float)60 / (float)FAUXCLICKY_TEMPO) * 1000;
note_start = timer_read(); note_start = timer_read();
FAUXCLICKY_ENABLE_OUTPUT; FAUXCLICKY_ENABLE_OUTPUT;
} }

@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdbool.h" #include "stdbool.h"
__attribute__ ((weak)) __attribute__ ((weak))
float fauxclicky_pressed_note[2]; float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
__attribute__ ((weak)) __attribute__ ((weak))
float fauxclicky_released_note[2]; float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
__attribute__ ((weak)) __attribute__ ((weak))
float fauxclicky_beep_note[2]; float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
bool fauxclicky_enabled; bool fauxclicky_enabled;
@ -73,11 +73,11 @@ bool fauxclicky_enabled;
#endif #endif
#ifndef FAUXCLICKY_ENABLE_OUTPUT #ifndef FAUXCLICKY_ENABLE_OUTPUT
#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1); #define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1)
#endif #endif
#ifndef FAUXCLICKY_DISABLE_OUTPUT #ifndef FAUXCLICKY_DISABLE_OUTPUT
#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0)); #define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0))
#endif #endif
#ifndef FAUXCLICKY_TIMER_PERIOD #ifndef FAUXCLICKY_TIMER_PERIOD

@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
__attribute__ ((weak)) __attribute__ ((weak))
uint16_t keymap_function_id_to_action( uint16_t function_id ) uint16_t keymap_function_id_to_action( uint16_t function_id )
{ {
// The compiler sees the empty (weak) fn_actions and generates a warning
// This function should not be called in that case, so the warning is too strict
// If this function is called however, the keymap should have overridden fn_actions, and then the compile
// is comparing against the wrong array
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
return pgm_read_word(&fn_actions[function_id]); return pgm_read_word(&fn_actions[function_id]);
#pragma GCC diagnostic pop
} }

@ -33,6 +33,10 @@
#define CH_E KC_E #define CH_E KC_E
#define CH_F KC_F #define CH_F KC_F
#define CH_G KC_G #define CH_G KC_G
#ifdef CH_H
// The ChibiOS ch.h file defines this...
#undef CH_H
#endif
#define CH_H KC_H #define CH_H KC_H
#define CH_I KC_I #define CH_I KC_I
#define CH_J KC_J #define CH_J KC_J

@ -0,0 +1,71 @@
/*
Copyright 2017 Fred Sundvik
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 "led_tables.h"
#ifdef USE_CIE1931_CURVE
// Lightness curve using the CIE 1931 lightness formula
//Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm
const uint8_t CIE1931_CURVE[] PROGMEM = {
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
242, 245, 247, 250, 252, 255,
};
#endif
#ifdef USE_LED_BREATHING_TABLE
const uint8_t LED_BREATHING_TABLE[] PROGMEM = {
0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9,
10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35,
37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76,
79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124,
127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173,
176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215,
218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244,
245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246,
245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220,
218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179,
176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131,
128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82,
79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40,
37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11,
10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0
};
#endif

@ -0,0 +1,30 @@
/*
Copyright 2017 Fred Sundvik
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 LED_TABLES_H
#define LED_TABLES_H
#include "progmem.h"
#include <stdint.h>
#ifdef USE_CIE1931_CURVE
extern const uint8_t CIE1931_CURVE[] PROGMEM;
#endif
#ifdef USE_LED_BREATHING_TABLE
extern const uint8_t LED_BREATHING_TABLE[] PROGMEM;
#endif
#endif

@ -20,12 +20,12 @@
bool printing_enabled = false; bool printing_enabled = false;
uint8_t character_shift = 0; uint8_t character_shift = 0;
void enabled_printing() { void enable_printing(void) {
printing_enabled = true; printing_enabled = true;
serial_init(); serial_init();
} }
void disable_printing() { void disable_printing(void) {
printing_enabled = false; printing_enabled = false;
} }
@ -41,9 +41,14 @@ void print_char(char c) {
USB_Init(); USB_Init();
} }
void print_box_string(uint8_t text[]) { void print_string(char c[]) {
uint8_t len = strlen(text); for(uint8_t i = 0; i < strlen(c); i++)
uint8_t out[len * 3 + 8]; print_char(c[i]);
}
void print_box_string(const char text[]) {
size_t len = strlen(text);
char out[len * 3 + 8];
out[0] = 0xDA; out[0] = 0xDA;
for (uint8_t i = 0; i < len; i++) { for (uint8_t i = 0; i < len; i++) {
out[i+1] = 0xC4; out[i+1] = 0xC4;
@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) {
print_string(out); print_string(out);
} }
void print_string(char c[]) {
for(uint8_t i = 0; i < strlen(c); i++)
print_char(c[i]);
}
bool process_printer(uint16_t keycode, keyrecord_t *record) { bool process_printer(uint16_t keycode, keyrecord_t *record) {
if (keycode == PRINT_ON) { if (keycode == PRINT_ON) {
enabled_printing(); enable_printing();
return false; return false;
} }
if (keycode == PRINT_OFF) { if (keycode == PRINT_OFF) {

@ -21,4 +21,6 @@
#include "protocol/serial.h" #include "protocol/serial.h"
bool process_printer(uint16_t keycode, keyrecord_t *record);
#endif #endif

@ -46,7 +46,7 @@ void serial_output(void) {
} }
void enabled_printing() { void enable_printing() {
printing_enabled = true; printing_enabled = true;
serial_output(); serial_output();
serial_high(); serial_high();
@ -82,7 +82,7 @@ void print_string(char c[]) {
bool process_printer(uint16_t keycode, keyrecord_t *record) { bool process_printer(uint16_t keycode, keyrecord_t *record) {
if (keycode == PRINT_ON) { if (keycode == PRINT_ON) {
enabled_printing(); enable_printing();
return false; return false;
} }
if (keycode == PRINT_OFF) { if (keycode == PRINT_OFF) {

@ -15,6 +15,7 @@
*/ */
#include "process_unicode.h" #include "process_unicode.h"
#include "action_util.h" #include "action_util.h"
#include "eeprom.h"
static uint8_t first_flag = 0; static uint8_t first_flag = 0;

@ -15,6 +15,7 @@
*/ */
#include "process_unicode_common.h" #include "process_unicode_common.h"
#include "eeprom.h"
static uint8_t input_mode; static uint8_t input_mode;
uint8_t mods; uint8_t mods;

@ -49,7 +49,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
const uint32_t* map = unicode_map; const uint32_t* map = unicode_map;
uint16_t index = keycode - QK_UNICODE_MAP; uint16_t index = keycode - QK_UNICODE_MAP;
uint32_t code = pgm_read_dword_far(&map[index]); uint32_t code = pgm_read_dword(&map[index]);
if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
// Convert to UTF-16 surrogate pair // Convert to UTF-16 surrogate pair
code -= 0x10000; code -= 0x10000;

@ -20,56 +20,8 @@
#include "timer.h" #include "timer.h"
#include "rgblight.h" #include "rgblight.h"
#include "debug.h" #include "debug.h"
#include "led_tables.h"
// Lightness curve using the CIE 1931 lightness formula
//Generated by the python script provided in http://jared.geek.nz/2013/feb/linear-led-pwm
const uint8_t DIM_CURVE[] PROGMEM = {
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
242, 245, 247, 250, 252, 255,
};
const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {
0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9,
10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35,
37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76,
79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124,
127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173,
176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215,
218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244,
245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246,
245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220,
218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179,
176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131,
128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82,
79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40,
37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11,
10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0
};
__attribute__ ((weak)) __attribute__ ((weak))
const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
@ -135,9 +87,9 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
break; break;
} }
} }
r = pgm_read_byte(&DIM_CURVE[r]); r = pgm_read_byte(&CIE1931_CURVE[r]);
g = pgm_read_byte(&DIM_CURVE[g]); g = pgm_read_byte(&CIE1931_CURVE[g]);
b = pgm_read_byte(&DIM_CURVE[b]); b = pgm_read_byte(&CIE1931_CURVE[b]);
setrgb(r, g, b, led1); setrgb(r, g, b, led1);
} }
@ -509,7 +461,7 @@ void rgblight_effect_breathing(uint8_t interval) {
} }
last_timer = timer_read(); last_timer = timer_read();
rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, pgm_read_byte(&RGBLED_BREATHING_TABLE[pos])); rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, pgm_read_byte(&LED_BREATHING_TABLE[pos]));
pos = (pos + 1) % 256; pos = (pos + 1) % 256;
} }
void rgblight_effect_rainbow_mood(uint8_t interval) { void rgblight_effect_rainbow_mood(uint8_t interval) {

@ -212,7 +212,7 @@ void serial_link_update(void) {
systime_t current_time = chVTGetSystemTimeX(); systime_t current_time = chVTGetSystemTimeX();
systime_t delta = current_time - last_update; systime_t delta = current_time - last_update;
if (changed || delta > US2ST(1000)) { if (changed || delta > US2ST(5000)) {
last_update = current_time; last_update = current_time;
last_matrix = matrix; last_matrix = matrix;
matrix_object_t* m = begin_write_keyboard_matrix(); matrix_object_t* m = begin_write_keyboard_matrix();

@ -1,36 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2016 Fred Sundvik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "keyboard.h"
#include "action_layer.h"
#include "visualizer.h"
#include "host.h"
void post_keyboard_init(void) {
visualizer_init();
}
void post_keyboard_task() {
visualizer_set_state(default_layer_state, layer_state, host_keyboard_leds());
}

@ -1,325 +0,0 @@
/**
* This file has a different license to the rest of the uGFX system.
* You can copy, modify and distribute this file as you see fit.
* You do not need to publish your source modifications to this file.
* The only thing you are not permitted to do is to relicense it
* under a different license.
*/
/**
* Copy this file into your project directory and rename it as gfxconf.h
* Edit your copy to turn on the uGFX features you want to use.
* The values below are the defaults.
*
* Only remove the comments from lines where you want to change the
* default value. This allows definitions to be included from
* driver makefiles when required and provides the best future
* compatibility for your project.
*
* Please use spaces instead of tabs in this file.
*/
#ifndef _GFXCONF_H
#define _GFXCONF_H
///////////////////////////////////////////////////////////////////////////
// GOS - One of these must be defined, preferably in your Makefile //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_OS_CHIBIOS TRUE
//#define GFX_USE_OS_FREERTOS FALSE
// #define GFX_FREERTOS_USE_TRACE FALSE
//#define GFX_USE_OS_WIN32 FALSE
//#define GFX_USE_OS_LINUX FALSE
//#define GFX_USE_OS_OSX FALSE
//#define GFX_USE_OS_ECOS FALSE
//#define GFX_USE_OS_RAWRTOS FALSE
//#define GFX_USE_OS_ARDUINO FALSE
//#define GFX_USE_OS_KEIL FALSE
//#define GFX_USE_OS_CMSIS FALSE
//#define GFX_USE_OS_RAW32 FALSE
// #define INTERRUPTS_OFF() optional_code
// #define INTERRUPTS_ON() optional_code
// These are not defined by default for some reason
#define GOS_NEED_X_THREADS FALSE
#define GOS_NEED_X_HEAP FALSE
// Options that (should where relevant) apply to all operating systems
#define GFX_NO_INLINE FALSE
// #define GFX_COMPILER GFX_COMPILER_UNKNOWN
// #define GFX_CPU GFX_CPU_UNKNOWN
// #define GFX_OS_HEAP_SIZE 0
// #define GFX_OS_NO_INIT FALSE
// #define GFX_OS_INIT_NO_WARNING FALSE
// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
///////////////////////////////////////////////////////////////////////////
// GDISP //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GDISP TRUE
//#define GDISP_NEED_AUTOFLUSH FALSE
//#define GDISP_NEED_TIMERFLUSH FALSE
//#define GDISP_NEED_VALIDATION TRUE
//#define GDISP_NEED_CLIP TRUE
//#define GDISP_NEED_CIRCLE FALSE
//#define GDISP_NEED_ELLIPSE FALSE
//#define GDISP_NEED_ARC FALSE
//#define GDISP_NEED_ARCSECTORS FALSE
//#define GDISP_NEED_CONVEX_POLYGON FALSE
//#define GDISP_NEED_SCROLL FALSE
//#define GDISP_NEED_PIXELREAD FALSE
//#define GDISP_NEED_CONTROL FALSE
//#define GDISP_NEED_QUERY FALSE
//#define GDISP_NEED_MULTITHREAD FALSE
//#define GDISP_NEED_STREAMING FALSE
#define GDISP_NEED_TEXT TRUE
// #define GDISP_NEED_TEXT_WORDWRAP FALSE
// #define GDISP_NEED_ANTIALIAS FALSE
// #define GDISP_NEED_UTF8 FALSE
#define GDISP_NEED_TEXT_KERNING TRUE
// #define GDISP_INCLUDE_FONT_UI1 FALSE
// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font.
// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE
#define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE
// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE
// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE
#define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE
// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE
// #define GDISP_INCLUDE_USER_FONTS FALSE
//#define GDISP_NEED_IMAGE FALSE
// #define GDISP_NEED_IMAGE_NATIVE FALSE
// #define GDISP_NEED_IMAGE_GIF FALSE
// #define GDISP_NEED_IMAGE_BMP FALSE
// #define GDISP_NEED_IMAGE_BMP_1 FALSE
// #define GDISP_NEED_IMAGE_BMP_4 FALSE
// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE
// #define GDISP_NEED_IMAGE_BMP_8 FALSE
// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE
// #define GDISP_NEED_IMAGE_BMP_16 FALSE
// #define GDISP_NEED_IMAGE_BMP_24 FALSE
// #define GDISP_NEED_IMAGE_BMP_32 FALSE
// #define GDISP_NEED_IMAGE_JPG FALSE
// #define GDISP_NEED_IMAGE_PNG FALSE
// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE
//#define GDISP_NEED_PIXMAP FALSE
// #define GDISP_NEED_PIXMAP_IMAGE FALSE
//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used.
//#define GDISP_LINEBUF_SIZE 128
//#define GDISP_STARTUP_COLOR Black
#define GDISP_NEED_STARTUP_LOGO FALSE
//#define GDISP_TOTAL_DISPLAYS 1
//#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_Win32
// #ifdef GDISP_DRIVER_LIST
// // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability
// #define GDISP_HARDWARE_STREAM_WRITE FALSE
// #define GDISP_HARDWARE_STREAM_READ FALSE
// #define GDISP_HARDWARE_STREAM_POS FALSE
// #define GDISP_HARDWARE_DRAWPIXEL FALSE
// #define GDISP_HARDWARE_CLEARS FALSE
// #define GDISP_HARDWARE_FILLS FALSE
// #define GDISP_HARDWARE_BITFILLS FALSE
// #define GDISP_HARDWARE_SCROLL FALSE
// #define GDISP_HARDWARE_PIXELREAD FALSE
// #define GDISP_HARDWARE_CONTROL FALSE
// #define GDISP_HARDWARE_QUERY FALSE
// #define GDISP_HARDWARE_CLIP FALSE
#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888
// #endif
// The custom format is not defined for some reason, so define it as error
// so we don't get compiler warnings
#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR
#define GDISP_USE_GFXNET FALSE
// #define GDISP_GFXNET_PORT 13001
// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE
// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE
// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE
///////////////////////////////////////////////////////////////////////////
// GWIN //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GWIN FALSE
//#define GWIN_NEED_WINDOWMANAGER FALSE
// #define GWIN_REDRAW_IMMEDIATE FALSE
// #define GWIN_REDRAW_SINGLEOP FALSE
// #define GWIN_NEED_FLASHING FALSE
// #define GWIN_FLASHING_PERIOD 250
//#define GWIN_NEED_CONSOLE FALSE
// #define GWIN_CONSOLE_USE_HISTORY FALSE
// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE
// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE
// #define GWIN_CONSOLE_ESCSEQ FALSE
// #define GWIN_CONSOLE_USE_BASESTREAM FALSE
// #define GWIN_CONSOLE_USE_FLOAT FALSE
//#define GWIN_NEED_GRAPH FALSE
//#define GWIN_NEED_GL3D FALSE
//#define GWIN_NEED_WIDGET FALSE
//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1
// #define GWIN_NEED_LABEL FALSE
// #define GWIN_LABEL_ATTRIBUTE FALSE
// #define GWIN_NEED_BUTTON FALSE
// #define GWIN_BUTTON_LAZY_RELEASE FALSE
// #define GWIN_NEED_SLIDER FALSE
// #define GWIN_SLIDER_NOSNAP FALSE
// #define GWIN_SLIDER_DEAD_BAND 5
// #define GWIN_SLIDER_TOGGLE_INC 20
// #define GWIN_NEED_CHECKBOX FALSE
// #define GWIN_NEED_IMAGE FALSE
// #define GWIN_NEED_IMAGE_ANIMATION FALSE
// #define GWIN_NEED_RADIO FALSE
// #define GWIN_NEED_LIST FALSE
// #define GWIN_NEED_LIST_IMAGES FALSE
// #define GWIN_NEED_PROGRESSBAR FALSE
// #define GWIN_PROGRESSBAR_AUTO FALSE
// #define GWIN_NEED_KEYBOARD FALSE
// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1
// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE
// #define GWIN_NEED_TEXTEDIT FALSE
// #define GWIN_FLAT_STYLING FALSE
// #define GWIN_WIDGET_TAGS FALSE
//#define GWIN_NEED_CONTAINERS FALSE
// #define GWIN_NEED_CONTAINER FALSE
// #define GWIN_NEED_FRAME FALSE
// #define GWIN_NEED_TABSET FALSE
// #define GWIN_TABSET_TABHEIGHT 18
///////////////////////////////////////////////////////////////////////////
// GEVENT //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GEVENT FALSE
//#define GEVENT_ASSERT_NO_RESOURCE FALSE
//#define GEVENT_MAXIMUM_SIZE 32
//#define GEVENT_MAX_SOURCE_LISTENERS 32
///////////////////////////////////////////////////////////////////////////
// GTIMER //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GTIMER FALSE
//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY
//#define GTIMER_THREAD_WORKAREA_SIZE 2048
///////////////////////////////////////////////////////////////////////////
// GQUEUE //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GQUEUE FALSE
//#define GQUEUE_NEED_ASYNC FALSE
//#define GQUEUE_NEED_GSYNC FALSE
//#define GQUEUE_NEED_FSYNC FALSE
//#define GQUEUE_NEED_BUFFERS FALSE
///////////////////////////////////////////////////////////////////////////
// GINPUT //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GINPUT FALSE
//#define GINPUT_NEED_MOUSE FALSE
// #define GINPUT_TOUCH_STARTRAW FALSE
// #define GINPUT_TOUCH_NOTOUCH FALSE
// #define GINPUT_TOUCH_NOCALIBRATE FALSE
// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE
// #define GINPUT_MOUSE_POLL_PERIOD 25
// #define GINPUT_MOUSE_CLICK_TIME 300
// #define GINPUT_TOUCH_CXTCLICK_TIME 700
// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE
// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE
// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32
//#define GINPUT_NEED_KEYBOARD FALSE
// #define GINPUT_KEYBOARD_POLL_PERIOD 200
// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32
// #define GKEYBOARD_LAYOUT_OFF FALSE
// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE
//#define GINPUT_NEED_TOGGLE FALSE
//#define GINPUT_NEED_DIAL FALSE
///////////////////////////////////////////////////////////////////////////
// GFILE //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GFILE FALSE
//#define GFILE_NEED_PRINTG FALSE
//#define GFILE_NEED_SCANG FALSE
//#define GFILE_NEED_STRINGS FALSE
//#define GFILE_NEED_FILELISTS FALSE
//#define GFILE_NEED_STDIO FALSE
//#define GFILE_NEED_NOAUTOMOUNT FALSE
//#define GFILE_NEED_NOAUTOSYNC FALSE
//#define GFILE_NEED_MEMFS FALSE
//#define GFILE_NEED_ROMFS FALSE
//#define GFILE_NEED_RAMFS FALSE
//#define GFILE_NEED_FATFS FALSE
//#define GFILE_NEED_NATIVEFS FALSE
//#define GFILE_NEED_CHBIOSFS FALSE
//#define GFILE_ALLOW_FLOATS FALSE
//#define GFILE_ALLOW_DEVICESPECIFIC FALSE
//#define GFILE_MAX_GFILES 3
///////////////////////////////////////////////////////////////////////////
// GADC //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GADC FALSE
//#define GADC_MAX_LOWSPEED_DEVICES 4
///////////////////////////////////////////////////////////////////////////
// GAUDIO //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GAUDIO FALSE
// There seems to be a bug in the ugfx code, the wrong define is used
// So define it in order to avoid warnings
#define GFX_USE_GAUDIN GFX_USE_GAUDIO
// #define GAUDIO_NEED_PLAY FALSE
// #define GAUDIO_NEED_RECORD FALSE
///////////////////////////////////////////////////////////////////////////
// GMISC //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GMISC FALSE
//#define GMISC_NEED_ARRAYOPS FALSE
//#define GMISC_NEED_FASTTRIG FALSE
//#define GMISC_NEED_FIXEDTRIG FALSE
//#define GMISC_NEED_INVSQRT FALSE
// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
// #define GMISC_INVSQRT_REAL_SLOW FALSE
//#define GMISC_NEED_MATRIXFLOAT2D FALSE
//#define GMISC_NEED_MATRIXFIXED2D FALSE
#endif /* _GFXCONF_H */

@ -1,91 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2016 Fred Sundvik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "lcd_backlight.h"
#include "hal.h"
#define RED_PIN 1
#define GREEN_PIN 2
#define BLUE_PIN 3
#define CHANNEL_RED FTM0->CHANNEL[0]
#define CHANNEL_GREEN FTM0->CHANNEL[1]
#define CHANNEL_BLUE FTM0->CHANNEL[2]
#define RGB_PORT PORTC
#define RGB_PORT_GPIO GPIOC
// Base FTM clock selection (72 MHz system clock)
// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period
// Higher pre-scalar will use the most power (also look the best)
// Pre-scalar calculations
// 0 - 72 MHz -> 549 Hz
// 1 - 36 MHz -> 275 Hz
// 2 - 18 MHz -> 137 Hz
// 3 - 9 MHz -> 69 Hz (Slightly visible flicker)
// 4 - 4 500 kHz -> 34 Hz (Visible flickering)
// 5 - 2 250 kHz -> 17 Hz
// 6 - 1 125 kHz -> 9 Hz
// 7 - 562 500 Hz -> 4 Hz
// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced
// Which will reduce the brightness range
#define PRESCALAR_DEFINE 0
void lcd_backlight_hal_init(void) {
// Setup Backlight
SIM->SCGC6 |= SIM_SCGC6_FTM0;
FTM0->CNT = 0; // Reset counter
// PWM Period
// 16-bit maximum
FTM0->MOD = 0xFFFF;
// Set FTM to PWM output - Edge Aligned, Low-true pulses
#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0)
CHANNEL_RED.CnSC = CNSC_MODE;
CHANNEL_GREEN.CnSC = CNSC_MODE;
CHANNEL_BLUE.CnSC = CNSC_MODE;
// System clock, /w prescalar setting
FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE);
CHANNEL_RED.CnV = 0;
CHANNEL_GREEN.CnV = 0;
CHANNEL_BLUE.CnV = 0;
RGB_PORT_GPIO->PDDR |= (1 << RED_PIN);
RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN);
RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN);
#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4)
RGB_PORT->PCR[RED_PIN] = RGB_MODE;
RGB_PORT->PCR[GREEN_PIN] = RGB_MODE;
RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
}
void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
CHANNEL_RED.CnV = r;
CHANNEL_GREEN.CnV = g;
CHANNEL_BLUE.CnV = b;
}

@ -1,121 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2016 Fred Sundvik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Currently we are assuming that both the backlight and LCD are enabled
// But it's entirely possible to write a custom visualizer that use only
// one of them
#ifndef LCD_BACKLIGHT_ENABLE
#error This visualizer needs that LCD backlight is enabled
#endif
#ifndef LCD_ENABLE
#error This visualizer needs that LCD is enabled
#endif
#include "visualizer.h"
static const char* welcome_text[] = {"TMK", "Infinity Ergodox"};
// Just an example how to write custom keyframe functions, we could have moved
// all this into the init function
bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
// Read the uGFX documentation for information how to use the displays
// http://wiki.ugfx.org/index.php/Main_Page
gdispClear(White);
// You can use static variables for things that can't be found in the animation
// or state structs
gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black);
gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black);
// Always remember to flush the display
gdispFlush();
// you could set the backlight color as well, but we won't do it here, since
// it's part of the following animation
// lcd_backlight_color(hue, saturation, intensity);
// We don't need constant updates, just drawing the screen once is enough
return false;
}
// Feel free to modify the animations below, or even add new ones if needed
// Don't worry, if the startup animation is long, you can use the keyboard like normal
// during that time
static keyframe_animation_t startup_animation = {
.num_frames = 4,
.loop = false,
.frame_lengths = {0, MS2ST(1000), MS2ST(5000), 0},
.frame_functions = {display_welcome, keyframe_animate_backlight_color, keyframe_no_operation, enable_visualization},
};
// The color animation animates the LCD color when you change layers
static keyframe_animation_t color_animation = {
.num_frames = 2,
.loop = false,
// Note that there's a 200 ms no-operation frame,
// this prevents the color from changing when activating the layer
// momentarily
.frame_lengths = {MS2ST(200), MS2ST(500)},
.frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color},
};
// The LCD animation alternates between the layer name display and a
// bitmap that displays all active layers
static keyframe_animation_t lcd_animation = {
.num_frames = 2,
.loop = true,
.frame_lengths = {MS2ST(2000), MS2ST(2000)},
.frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap},
};
void initialize_user_visualizer(visualizer_state_t* state) {
// The brightness will be dynamically adjustable in the future
// But for now, change it here.
lcd_backlight_brightness(0x50);
state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF);
state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF);
start_keyframe_animation(&startup_animation);
}
void update_user_visualizer_state(visualizer_state_t* state) {
// Add more tests, change the colors and layer texts here
// Usually you want to check the high bits (higher layers first)
// because that's the order layers are processed for keypresses
// You can for check for example:
// state->status.layer
// state->status.default_layer
// state->status.leds (see led.h for available statuses)
if (state->status.layer & 0x2) {
state->target_lcd_color = LCD_COLOR(0xA0, 0xB0, 0xFF);
state->layer_text = "Layer 2";
}
else {
state->target_lcd_color = LCD_COLOR(0x50, 0xB0, 0xFF);
state->layer_text = "Layer 1";
}
// You can also stop existing animations, and start your custom ones here
// remember that you should normally have only one animation for the LCD
// and one for the background. But you can also combine them if you want.
start_keyframe_animation(&lcd_animation);
start_keyframe_animation(&color_animation);
}

@ -25,10 +25,10 @@ SOFTWARE.
#include "lcd_backlight.h" #include "lcd_backlight.h"
#include <math.h> #include <math.h>
static uint8_t current_hue = 0x00; static uint8_t current_hue = 0;
static uint8_t current_saturation = 0x00; static uint8_t current_saturation = 0;
static uint8_t current_intensity = 0xFF; static uint8_t current_intensity = 0;
static uint8_t current_brightness = 0x7F; static uint8_t current_brightness = 0;
void lcd_backlight_init(void) { void lcd_backlight_init(void) {
lcd_backlight_hal_init(); lcd_backlight_hal_init();

@ -32,6 +32,10 @@ SOFTWARE.
#define LCD_SAT(color) ((color >> 8) & 0xFF) #define LCD_SAT(color) ((color >> 8) & 0xFF)
#define LCD_INT(color) (color & 0xFF) #define LCD_INT(color) (color & 0xFF)
inline uint32_t change_lcd_color_intensity(uint32_t color, uint8_t new_intensity) {
return (color & 0xFFFFFF00) | new_intensity;
}
void lcd_backlight_init(void); void lcd_backlight_init(void);
void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity); void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity);
void lcd_backlight_brightness(uint8_t b); void lcd_backlight_brightness(uint8_t b);

@ -0,0 +1,77 @@
/* Copyright 2017 Fred Sundvik
*
* 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 "lcd_backlight_keyframes.h"
bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) {
int frame_length = animation->frame_lengths[animation->current_frame];
int current_pos = frame_length - animation->time_left_in_frame;
uint8_t t_h = LCD_HUE(state->target_lcd_color);
uint8_t t_s = LCD_SAT(state->target_lcd_color);
uint8_t t_i = LCD_INT(state->target_lcd_color);
uint8_t p_h = LCD_HUE(state->prev_lcd_color);
uint8_t p_s = LCD_SAT(state->prev_lcd_color);
uint8_t p_i = LCD_INT(state->prev_lcd_color);
uint8_t d_h1 = t_h - p_h; //Modulo arithmetic since we want to wrap around
int d_h2 = t_h - p_h;
// Chose the shortest way around
int d_h = abs(d_h2) < d_h1 ? d_h2 : d_h1;
int d_s = t_s - p_s;
int d_i = t_i - p_i;
int hue = (d_h * current_pos) / frame_length;
int sat = (d_s * current_pos) / frame_length;
int intensity = (d_i * current_pos) / frame_length;
//dprintf("%X -> %X = %X\n", p_h, t_h, hue);
hue += p_h;
sat += p_s;
intensity += p_i;
state->current_lcd_color = LCD_COLOR(hue, sat, intensity);
lcd_backlight_color(
LCD_HUE(state->current_lcd_color),
LCD_SAT(state->current_lcd_color),
LCD_INT(state->current_lcd_color));
return true;
}
bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
state->prev_lcd_color = state->target_lcd_color;
state->current_lcd_color = state->target_lcd_color;
lcd_backlight_color(
LCD_HUE(state->current_lcd_color),
LCD_SAT(state->current_lcd_color),
LCD_INT(state->current_lcd_color));
return false;
}
bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
lcd_backlight_hal_color(0, 0, 0);
return false;
}
bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
lcd_backlight_color(LCD_HUE(state->current_lcd_color),
LCD_SAT(state->current_lcd_color),
LCD_INT(state->current_lcd_color));
return false;
}

@ -0,0 +1,30 @@
/* Copyright 2017 Fred Sundvik
*
* 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 QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
#include "visualizer.h"
// Animates the LCD backlight color between the current color and the target color (of the state)
bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state);
// Sets the backlight color to the target color
bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state);
bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
#endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */

@ -0,0 +1,188 @@
/* Copyright 2017 Fred Sundvik
*
* 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 "lcd_keyframes.h"
#include <string.h>
#include "action_util.h"
#include "led.h"
#include "resources/resources.h"
bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
gdispClear(White);
gdispDrawString(0, 10, state->layer_text, state->font_dejavusansbold12, Black);
return false;
}
static void format_layer_bitmap_string(uint16_t default_layer, uint16_t layer, char* buffer) {
for (int i=0; i<16;i++)
{
uint32_t mask = (1u << i);
if (default_layer & mask) {
if (layer & mask) {
*buffer = 'B';
} else {
*buffer = 'D';
}
} else if (layer & mask) {
*buffer = '1';
} else {
*buffer = '0';
}
++buffer;
if (i==3 || i==7 || i==11) {
*buffer = ' ';
++buffer;
}
}
*buffer = 0;
}
bool lcd_keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
const char* layer_help = "1=On D=Default B=Both";
char layer_buffer[16 + 4]; // 3 spaces and one null terminator
gdispClear(White);
gdispDrawString(0, 0, layer_help, state->font_fixed5x8, Black);
format_layer_bitmap_string(state->status.default_layer, state->status.layer, layer_buffer);
gdispDrawString(0, 10, layer_buffer, state->font_fixed5x8, Black);
format_layer_bitmap_string(state->status.default_layer >> 16, state->status.layer >> 16, layer_buffer);
gdispDrawString(0, 20, layer_buffer, state->font_fixed5x8, Black);
return false;
}
static void format_mods_bitmap_string(uint8_t mods, char* buffer) {
*buffer = ' ';
++buffer;
for (int i = 0; i<8; i++)
{
uint32_t mask = (1u << i);
if (mods & mask) {
*buffer = '1';
} else {
*buffer = '0';
}
++buffer;
if (i==3) {
*buffer = ' ';
++buffer;
}
}
*buffer = 0;
}
bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
const char* title = "Modifier states";
const char* mods_header = " CSAG CSAG ";
char status_buffer[12];
gdispClear(White);
gdispDrawString(0, 0, title, state->font_fixed5x8, Black);
gdispDrawString(0, 10, mods_header, state->font_fixed5x8, Black);
format_mods_bitmap_string(state->status.mods, status_buffer);
gdispDrawString(0, 20, status_buffer, state->font_fixed5x8, Black);
return false;
}
#define LED_STATE_STRING_SIZE sizeof("NUM CAPS SCRL COMP KANA")
static void get_led_state_string(char* output, visualizer_state_t* state) {
uint8_t pos = 0;
if (state->status.leds & (1u << USB_LED_NUM_LOCK)) {
memcpy(output + pos, "NUM ", 4);
pos += 4;
}
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
memcpy(output + pos, "CAPS ", 5);
pos += 5;
}
if (state->status.leds & (1u << USB_LED_SCROLL_LOCK)) {
memcpy(output + pos, "SCRL ", 5);
pos += 5;
}
if (state->status.leds & (1u << USB_LED_COMPOSE)) {
memcpy(output + pos, "COMP ", 5);
pos += 5;
}
if (state->status.leds & (1u << USB_LED_KANA)) {
memcpy(output + pos, "KANA", 4);
pos += 4;
}
output[pos] = 0;
}
bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state)
{
(void)animation;
char output[LED_STATE_STRING_SIZE];
get_led_state_string(output, state);
gdispClear(White);
gdispDrawString(0, 10, output, state->font_dejavusansbold12, Black);
return false;
}
bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
gdispClear(White);
uint8_t y = 10;
if (state->status.leds) {
char output[LED_STATE_STRING_SIZE];
get_led_state_string(output, state);
gdispDrawString(0, 1, output, state->font_dejavusansbold12, Black);
y = 17;
}
gdispDrawString(0, y, state->layer_text, state->font_dejavusansbold12, Black);
return false;
}
bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
(void)animation;
// Read the uGFX documentation for information how to use the displays
// http://wiki.ugfx.org/index.php/Main_Page
gdispClear(White);
// You can use static variables for things that can't be found in the animation
// or state structs, here we use the image
//gdispGBlitArea is a tricky function to use since it supports blitting part of the image
// if you have full screen image, then just use 128 and 32 for both source and target dimensions
gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
return false;
}
bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
gdispSetPowerMode(powerOff);
return false;
}
bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
gdispSetPowerMode(powerOn);
return false;
}

@ -0,0 +1,39 @@
/* Copyright 2017 Fred Sundvik
*
* 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 QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_
#include "visualizer.h"
// Displays the layer text centered vertically on the screen
bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active layers
bool lcd_keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active mods
bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA)
bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays both the layer text and the led states
bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the QMK logo on the LCD screen
bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state);
bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
#endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */

@ -21,50 +21,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "led_test.h"
#include "gfx.h" #include "gfx.h"
#include "math.h" #include "math.h"
#include "led_keyframes.h"
#define CROSSFADE_TIME 1000
#define GRADIENT_TIME 3000
keyframe_animation_t led_test_animation = {
.num_frames = 14,
.loop = true,
.frame_lengths = {
gfxMillisecondsToTicks(1000), // fade in
gfxMillisecondsToTicks(1000), // no op (leds on)
gfxMillisecondsToTicks(1000), // fade out
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
0, // mirror leds
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
0, // normal leds
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
},
.frame_functions = {
keyframe_fade_in_all_leds,
keyframe_no_operation,
keyframe_fade_out_all_leds,
keyframe_led_crossfade,
keyframe_led_left_to_right_gradient,
keyframe_led_crossfade,
keyframe_led_top_to_bottom_gradient,
keyframe_mirror_led_orientation,
keyframe_led_crossfade,
keyframe_led_left_to_right_gradient,
keyframe_led_crossfade,
keyframe_led_top_to_bottom_gradient,
keyframe_normal_led_orientation,
keyframe_led_crossfade,
},
};
static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) { static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) {
int frame_length = animation->frame_lengths[animation->current_frame]; int frame_length = animation->frame_lengths[animation->current_frame];
@ -96,19 +55,19 @@ static uint8_t compute_gradient_color(float t, float index, float num) {
return (uint8_t)(255.0f * v); return (uint8_t)(255.0f * v);
} }
bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
keyframe_fade_all_leds_from_to(animation, 0, 255); keyframe_fade_all_leds_from_to(animation, 0, 255);
return true; return true;
} }
bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
keyframe_fade_all_leds_from_to(animation, 255, 0); keyframe_fade_all_leds_from_to(animation, 255, 0);
return true; return true;
} }
bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
float frame_length = animation->frame_lengths[animation->current_frame]; float frame_length = animation->frame_lengths[animation->current_frame];
float current_pos = frame_length - animation->time_left_in_frame; float current_pos = frame_length - animation->time_left_in_frame;
@ -120,7 +79,7 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual
return true; return true;
} }
bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
float frame_length = animation->frame_lengths[animation->current_frame]; float frame_length = animation->frame_lengths[animation->current_frame];
float current_pos = frame_length - animation->time_left_in_frame; float current_pos = frame_length - animation->time_left_in_frame;
@ -139,7 +98,7 @@ static void copy_current_led_state(uint8_t* dest) {
} }
} }
} }
bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
if (animation->first_update_of_frame) { if (animation->first_update_of_frame) {
copy_current_led_state(&crossfade_start_frame[0][0]); copy_current_led_state(&crossfade_start_frame[0][0]);
@ -155,14 +114,14 @@ bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t*
return true; return true;
} }
bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
(void)animation; (void)animation;
gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180);
return false; return false;
} }
bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state; (void)state;
(void)animation; (void)animation;
gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0);

@ -22,20 +22,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#ifndef TMK_VISUALIZER_LED_TEST_H_ #ifndef LED_KEYFRAMES_H
#define TMK_VISUALIZER_LED_TEST_H_ #define LED_KEYFRAMES_H
#include "visualizer.h" #include "visualizer.h"
bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
extern keyframe_animation_t led_test_animation; extern keyframe_animation_t led_test_animation;
#endif /* TMK_VISUALIZER_LED_TEST_H_ */ #endif /* LED_KEYFRAMES_H */

@ -0,0 +1,61 @@
/* Copyright 2017 Fred Sundvik
*
* 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 "resources.h"
// To generate an image array like this
// Ensure the image is 128 x 32 or smaller
// Convert the bitmap to a C array using a program like http://www.riuson.com/lcd-image-converter/
// Ensure the the conversion process produces a monochrome format array - 1 bit/pixel, left to right, top to bottom
// Update array in the source code with the C array produced by the conversion program
// The image below is generated from lcd_logo.png
const uint8_t resource_lcd_logo[512] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0xfe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x06, 0x29, 0x41, 0x24, 0x52, 0x24, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x42, 0xaa, 0xaa, 0xaa, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x82, 0x28, 0xaa, 0xae, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x09, 0x55, 0x43, 0x28, 0xaa, 0xaa, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x0a, 0x55, 0x42, 0x28, 0xaa, 0xaa, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x38, 0x38, 0x05, 0x45, 0x42, 0x28, 0x89, 0x4a, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x38, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x38, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0e, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xff, 0x80, 0x04, 0x45, 0x14, 0xa4, 0x92, 0x83, 0x52, 0x22, 0x22, 0x36, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0xba, 0x84, 0x55, 0x55, 0x57, 0x45, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x08, 0xaa, 0xaa, 0xaa, 0x92, 0xb2, 0x55, 0x55, 0x42, 0x65, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x08, 0xaa, 0xaa, 0xaa, 0x92, 0x81, 0x56, 0x65, 0x42, 0x45, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x0a, 0xaa, 0xaa, 0xaa, 0x92, 0x81, 0x54, 0x45, 0x42, 0x45, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x04, 0x48, 0xa2, 0x4a, 0x89, 0x06, 0x24, 0x42, 0x41, 0x36, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

@ -0,0 +1,27 @@
/* Copyright 2017 Fred Sundvik
*
* 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 QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_
#define QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_
#include <stdint.h>
#ifdef LCD_ENABLE
extern const uint8_t resource_lcd_logo[];
#endif
#endif /* QUANTUM_VISUALIZER_RESOURCES_RESOURCES_H_ */

@ -48,20 +48,22 @@ SOFTWARE.
#include "serial_link/system/serial_link.h" #include "serial_link/system/serial_link.h"
#endif #endif
#include "action_util.h"
// Define this in config.h // Define this in config.h
#ifndef VISUALIZER_THREAD_PRIORITY #ifndef VISUALIZER_THREAD_PRIORITY
#define "Visualizer thread priority not defined" #define "Visualizer thread priority not defined"
#endif #endif
// mods status
#include "action_util.h"
static visualizer_keyboard_status_t current_status = { static visualizer_keyboard_status_t current_status = {
.layer = 0xFFFFFFFF, .layer = 0xFFFFFFFF,
.default_layer = 0xFFFFFFFF, .default_layer = 0xFFFFFFFF,
.mods = 0xFF, .mods = 0xFF,
.leds = 0xFFFFFFFF, .leds = 0xFFFFFFFF,
.suspended = false, .suspended = false,
#ifdef VISUALIZER_USER_DATA_SIZE
.user_data = {0}
#endif
}; };
static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) {
@ -69,11 +71,19 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa
status1->default_layer == status2->default_layer && status1->default_layer == status2->default_layer &&
status1->mods == status2->mods && status1->mods == status2->mods &&
status1->leds == status2->leds && status1->leds == status2->leds &&
status1->suspended == status2->suspended; status1->suspended == status2->suspended
#ifdef VISUALIZER_USER_DATA_SIZE
&& memcmp(status1->user_data, status2->user_data, VISUALIZER_USER_DATA_SIZE) == 0
#endif
;
} }
static bool visualizer_enabled = false; static bool visualizer_enabled = false;
#ifdef VISUALIZER_USER_DATA_SIZE
static uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
#endif
#define MAX_SIMULTANEOUS_ANIMATIONS 4 #define MAX_SIMULTANEOUS_ANIMATIONS 4
static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {};
@ -144,6 +154,14 @@ void stop_all_keyframe_animations(void) {
} }
} }
static uint8_t get_num_running_animations(void) {
uint8_t count = 0;
for (int i=0;i<MAX_SIMULTANEOUS_ANIMATIONS;i++) {
count += animations[i] ? 1 : 0;
}
return count;
}
static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systemticks_t delta, systemticks_t* sleep_time) { static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systemticks_t delta, systemticks_t* sleep_time) {
// TODO: Clean up this messy code // TODO: Clean up this messy code
dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame, dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame,
@ -212,175 +230,6 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat
(*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state); (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state);
} }
bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
return false;
}
#ifdef LCD_BACKLIGHT_ENABLE
bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) {
int frame_length = animation->frame_lengths[animation->current_frame];
int current_pos = frame_length - animation->time_left_in_frame;
uint8_t t_h = LCD_HUE(state->target_lcd_color);
uint8_t t_s = LCD_SAT(state->target_lcd_color);
uint8_t t_i = LCD_INT(state->target_lcd_color);
uint8_t p_h = LCD_HUE(state->prev_lcd_color);
uint8_t p_s = LCD_SAT(state->prev_lcd_color);
uint8_t p_i = LCD_INT(state->prev_lcd_color);
uint8_t d_h1 = t_h - p_h; //Modulo arithmetic since we want to wrap around
int d_h2 = t_h - p_h;
// Chose the shortest way around
int d_h = abs(d_h2) < d_h1 ? d_h2 : d_h1;
int d_s = t_s - p_s;
int d_i = t_i - p_i;
int hue = (d_h * current_pos) / frame_length;
int sat = (d_s * current_pos) / frame_length;
int intensity = (d_i * current_pos) / frame_length;
//dprintf("%X -> %X = %X\n", p_h, t_h, hue);
hue += p_h;
sat += p_s;
intensity += p_i;
state->current_lcd_color = LCD_COLOR(hue, sat, intensity);
lcd_backlight_color(
LCD_HUE(state->current_lcd_color),
LCD_SAT(state->current_lcd_color),
LCD_INT(state->current_lcd_color));
return true;
}
bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
state->prev_lcd_color = state->target_lcd_color;
state->current_lcd_color = state->target_lcd_color;
lcd_backlight_color(
LCD_HUE(state->current_lcd_color),
LCD_SAT(state->current_lcd_color),
LCD_INT(state->current_lcd_color));
return false;
}
#endif // LCD_BACKLIGHT_ENABLE
#ifdef LCD_ENABLE
bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
gdispClear(White);
gdispDrawString(0, 10, state->layer_text, state->font_dejavusansbold12, Black);
gdispFlush();
return false;
}
static void format_layer_bitmap_string(uint16_t default_layer, uint16_t layer, char* buffer) {
for (int i=0; i<16;i++)
{
uint32_t mask = (1u << i);
if (default_layer & mask) {
if (layer & mask) {
*buffer = 'B';
} else {
*buffer = 'D';
}
} else if (layer & mask) {
*buffer = '1';
} else {
*buffer = '0';
}
++buffer;
if (i==3 || i==7 || i==11) {
*buffer = ' ';
++buffer;
}
}
*buffer = 0;
}
bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
const char* layer_help = "1=On D=Default B=Both";
char layer_buffer[16 + 4]; // 3 spaces and one null terminator
gdispClear(White);
gdispDrawString(0, 0, layer_help, state->font_fixed5x8, Black);
format_layer_bitmap_string(state->status.default_layer, state->status.layer, layer_buffer);
gdispDrawString(0, 10, layer_buffer, state->font_fixed5x8, Black);
format_layer_bitmap_string(state->status.default_layer >> 16, state->status.layer >> 16, layer_buffer);
gdispDrawString(0, 20, layer_buffer, state->font_fixed5x8, Black);
gdispFlush();
return false;
}
static void format_mods_bitmap_string(uint8_t mods, char* buffer) {
*buffer = ' ';
++buffer;
for (int i = 0; i<8; i++)
{
uint32_t mask = (1u << i);
if (mods & mask) {
*buffer = '1';
} else {
*buffer = '0';
}
++buffer;
if (i==3) {
*buffer = ' ';
++buffer;
}
}
*buffer = 0;
}
bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
const char* title = "Modifier states";
const char* mods_header = " CSAG CSAG ";
char status_buffer[12];
gdispClear(White);
gdispDrawString(0, 0, title, state->font_fixed5x8, Black);
gdispDrawString(0, 10, mods_header, state->font_fixed5x8, Black);
format_mods_bitmap_string(state->status.mods, status_buffer);
gdispDrawString(0, 20, status_buffer, state->font_fixed5x8, Black);
gdispFlush();
return false;
}
#endif // LCD_ENABLE
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
#ifdef LCD_ENABLE
gdispSetPowerMode(powerOff);
#endif
#ifdef LCD_BACKLIGHT_ENABLE
lcd_backlight_hal_color(0, 0, 0);
#endif
return false;
}
bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
#ifdef LCD_ENABLE
gdispSetPowerMode(powerOn);
#endif
return false;
}
bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
dprint("User visualizer inited\n");
visualizer_enabled = true;
return false;
}
// TODO: Optimize the stack size, this is probably way too big // TODO: Optimize the stack size, this is probably way too big
static DECLARE_THREAD_STACK(visualizerThreadStack, 1024); static DECLARE_THREAD_STACK(visualizerThreadStack, 1024);
static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
@ -396,6 +245,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
.mods = 0xFF, .mods = 0xFF,
.leds = 0xFFFFFFFF, .leds = 0xFFFFFFFF,
.suspended = false, .suspended = false,
#ifdef VISUALIZER_USER_DATA_SIZE
.user_data = {0},
#endif
}; };
visualizer_state_t state = { visualizer_state_t state = {
@ -418,13 +270,15 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
systemticks_t sleep_time = TIME_INFINITE; systemticks_t sleep_time = TIME_INFINITE;
systemticks_t current_time = gfxSystemTicks(); systemticks_t current_time = gfxSystemTicks();
bool force_update = true;
while(true) { while(true) {
systemticks_t new_time = gfxSystemTicks(); systemticks_t new_time = gfxSystemTicks();
systemticks_t delta = new_time - current_time; systemticks_t delta = new_time - current_time;
current_time = new_time; current_time = new_time;
bool enabled = visualizer_enabled; bool enabled = visualizer_enabled;
if (!same_status(&state.status, &current_status)) { if (force_update || !same_status(&state.status, &current_status)) {
force_update = false;
if (visualizer_enabled) { if (visualizer_enabled) {
if (current_status.suspended) { if (current_status.suspended) {
stop_all_keyframe_animations(); stop_all_keyframe_animations();
@ -433,8 +287,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
user_visualizer_suspend(&state); user_visualizer_suspend(&state);
} }
else { else {
visualizer_keyboard_status_t prev_status = state.status;
state.status = current_status; state.status = current_status;
update_user_visualizer_state(&state); update_user_visualizer_state(&state, &prev_status);
} }
state.prev_lcd_color = state.current_lcd_color; state.prev_lcd_color = state.current_lcd_color;
} }
@ -458,13 +313,17 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
gdispGFlush(LED_DISPLAY); gdispGFlush(LED_DISPLAY);
#endif #endif
#ifdef LCD_ENABLE
gdispGFlush(LCD_DISPLAY);
#endif
#ifdef EMULATOR #ifdef EMULATOR
draw_emulator(); draw_emulator();
#endif #endif
// The animation can enable the visualizer // Enable the visualizer when the startup or the suspend animation has finished
// And we might need to update the state when that happens if (!visualizer_enabled && state.status.suspended == false && get_num_running_animations() == 0) {
// so don't sleep visualizer_enabled = true;
if (enabled != visualizer_enabled) { force_update = true;
sleep_time = 0; sleep_time = 0;
} }
@ -554,6 +413,12 @@ uint8_t visualizer_get_mods() {
return mods; return mods;
} }
#ifdef VISUALIZER_USER_DATA_SIZE
void visualizer_set_user_data(void* u) {
memcpy(user_data, u, VISUALIZER_USER_DATA_SIZE);
}
#endif
void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds) { void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds) {
// Note that there's a small race condition here, the thread could read // Note that there's a small race condition here, the thread could read
// a state where one of these are set but not the other. But this should // a state where one of these are set but not the other. But this should
@ -582,6 +447,9 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uin
.leds = leds, .leds = leds,
.suspended = current_status.suspended, .suspended = current_status.suspended,
}; };
#ifdef VISUALIZER_USER_DATA_SIZE
memcpy(new_status.user_data, user_data, VISUALIZER_USER_DATA_SIZE);
#endif
if (!same_status(&current_status, &new_status)) { if (!same_status(&current_status, &new_status)) {
changed = true; changed = true;
current_status = new_status; current_status = new_status;

@ -34,7 +34,7 @@ SOFTWARE.
#include "lcd_backlight.h" #include "lcd_backlight.h"
#endif #endif
// use this function to merget both real_mods and oneshot_mods in a uint16_t // use this function to merge both real_mods and oneshot_mods in a uint16_t
uint8_t visualizer_get_mods(void); uint8_t visualizer_get_mods(void);
// This need to be called once at the start // This need to be called once at the start
@ -68,6 +68,9 @@ typedef struct {
uint8_t mods; uint8_t mods;
uint32_t leds; // See led.h for available statuses uint32_t leds; // See led.h for available statuses
bool suspended; bool suspended;
#ifdef VISUALIZER_USER_DATA_SIZE
uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
#endif
} visualizer_keyboard_status_t; } visualizer_keyboard_status_t;
// The state struct is used by the various keyframe functions // The state struct is used by the various keyframe functions
@ -123,32 +126,22 @@ void stop_keyframe_animation(keyframe_animation_t* animation);
// Useful for crossfades for example // Useful for crossfades for example
void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state);
// Some predefined keyframe functions that can be used by the user code // The master can set userdata which will be transferred to the slave
// Does nothing, useful for adding delays #ifdef VISUALIZER_USER_DATA_SIZE
bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); void visualizer_set_user_data(void* user_data);
// Animates the LCD backlight color between the current color and the target color (of the state) #endif
bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state);
// Sets the backlight color to the target color
bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the layer text centered vertically on the screen
bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active layers
bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays a bitmap (0/1) of all the currently active mods
bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
// Call this once, when the initial animation has finished, alternatively you can call it
// directly from the initalize_user_visualizer function (the animation can be null)
bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state);
// These functions have to be implemented by the user // These functions have to be implemented by the user
void initialize_user_visualizer(visualizer_state_t* state); // Called regularly each time the state has changed (but not every scan loop)
void update_user_visualizer_state(visualizer_state_t* state); void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status);
// Called when the computer goes to suspend, will also stop calling update_user_visualizer_state
void user_visualizer_suspend(visualizer_state_t* state); void user_visualizer_suspend(visualizer_state_t* state);
// You have to start at least one animation as a response to the following two functions
// When the animation has finished the visualizer will resume normal operation and start calling the
// update_user_visualizer_state again
// Called when the keyboard boots up
void initialize_user_visualizer(visualizer_state_t* state);
// Called when the computer resumes from a suspend
void user_visualizer_resume(visualizer_state_t* state); void user_visualizer_resume(visualizer_state_t* state);
#endif /* VISUALIZER_H */ #endif /* VISUALIZER_H */

@ -20,7 +20,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
SRC += $(VISUALIZER_DIR)/visualizer.c SRC += $(VISUALIZER_DIR)/visualizer.c \
$(VISUALIZER_DIR)/visualizer_keyframes.c
EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR)
GFXLIB = $(LIB_PATH)/ugfx GFXLIB = $(LIB_PATH)/ugfx
VPATH += $(VISUALIZER_PATH) VPATH += $(VISUALIZER_PATH)
@ -32,25 +33,33 @@ OPT_DEFS += -DLCD_ENABLE
ULIBS += -lm ULIBS += -lm
endif endif
ifdef LCD_BACKLIGHT_ENABLE ifeq ($(strip $(LCD_ENABLE)), yes)
SRC += $(VISUALIZER_DIR)/lcd_backlight.c SRC += $(VISUALIZER_DIR)/lcd_backlight.c
SRC += $(VISUALIZER_DIR)/lcd_keyframes.c
SRC += $(VISUALIZER_DIR)/lcd_backlight_keyframes.c
# Note, that the linker will strip out any resources that are not actually in use
SRC += $(VISUALIZER_DIR)/resources/lcd_logo.c
OPT_DEFS += -DLCD_BACKLIGHT_ENABLE OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
endif endif
ifdef LED_ENABLE ifeq ($(strip $(LED_ENABLE)), yes)
SRC += $(VISUALIZER_DIR)/led_test.c SRC += $(VISUALIZER_DIR)/led_keyframes.c
OPT_DEFS += -DLED_ENABLE OPT_DEFS += -DLED_ENABLE
endif endif
include $(GFXLIB)/gfx.mk include $(GFXLIB)/gfx.mk
SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) GFXSRC := $(patsubst $(TOP_DIR)/%,%,$(GFXSRC))
OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) GFXDEFS := $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS)))
ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","") ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","")
SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c
else else
ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","") ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","")
ifeq ("$(wildcard $(SUBPROJECT_PATH)/visualizer.c)","")
$(error "$(KEYMAP_PATH)/visualizer.c" does not exist) $(error "$(KEYMAP_PATH)/visualizer.c" does not exist)
else
SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/visualizer.c
endif
else else
SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c
endif endif

@ -0,0 +1,23 @@
/* Copyright 2017 Fred Sundvik
*
* 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 "visualizer_keyframes.h"
bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
return false;
}

@ -0,0 +1,26 @@
/* Copyright 2017 Fred Sundvik
*
* 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 QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_
#include "visualizer.h"
// Some predefined keyframe functions that can be used by the user code
// Does nothing, useful for adding delays
bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state);
#endif /* QUANTUM_VISUALIZER_VISUALIZER_KEYFRAMES_H_ */

@ -1,18 +1,21 @@
# Quantum Mechanical Keyboard Firmware # Quantum Mechanical Keyboard Firmware
[![Build Status](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) [![Gitter](https://badges.gitter.im/qmk/qmk_firmware.svg)](https://gitter.im/qmk/qmk_firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build Status](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware)
[![Gitter](https://img.shields.io/gitter/room/qmk/qmk_firmware.js.svg)](https://gitter.im/qmk/qmk_firmware)
[![Docs Status](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm)
[![GitHub contributors](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly)
[![GitHub forks](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/)
This is a keyboard firmware based on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). This is a keyboard firmware based on the [tmk\_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/).
## Official website (currently under construction with the move to the wiki) ## Official website
For an easy-to-read version of this document and the repository, check out [http://qmk.fm](http://qmk.fm). Nicely formatted keyboard and keymap listings are also available there, along with the ability to download .hex files instead of having to setup a build environment and compile them. [http://qmk.fm](http://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.
## Included Keyboards ## Supported Keyboards
* [Planck](/keyboards/planck/) * [Planck](/keyboards/planck/)
* [Preonic](/keyboards/preonic/) * [Preonic](/keyboards/preonic/)
* [Atomic](/keyboards/atomic/)
* [ErgoDox EZ](/keyboards/ergodox/) * [ErgoDox EZ](/keyboards/ergodox/)
* [Clueboard](/keyboards/clueboard/) * [Clueboard](/keyboards/clueboard/)
* [Cluepad](/keyboards/cluepad/) * [Cluepad](/keyboards/cluepad/)
@ -21,19 +24,8 @@ The project also includes community support for [lots of other keyboards](/keybo
## Maintainers ## Maintainers
QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). This repo used to be a fork of [TMK](https://github.com/tmk/tmk_keyboard), and we are incredibly grateful for his founding contributions to the firmware. We've had to break the fork due to purely technical reasons - it simply became too different over time, and we've had to start refactoring some of the basic bits and pieces. We are huge fans of TMK and Hasu :) QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), and the Clueboard by [Zach White](https://github.com/skullydazed).
This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If you spot any typos or inaccuracies, please [open an issue](https://github.com/qmk/qmk_firmware/issues/new). ## Documentation
The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), and the Clueboard by [Zach White](https://github.com/skullydazed). [https://docs.qmk.fm](https://docs.qmk.fm) is hosted on [Gitbook](https://www.gitbook.com/book/qmk/firmware/details) and [Github](https://github.com/qmk/qmk_firmware_docs/) (they are synced). You can request changes by making a fork and [pull request](https://github.com/qmk/qmk_firmware_docs/pulls), or by clicking the "suggest an edit" link on any page of the Docs.
## Documentation roadmap
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 Wiki**](https://github.com/qmk/qmk_firmware/wiki) - the entirety of the readme has been moved here
* The readme for your own keyboard: This is found under `keyboards/<your keyboards's name>/`. So for the ErgoDox, it's [here](keyboards/ergodox/); for the Planck, it's [here](keyboards/planck/) and so on.
* The list of possible keycodes you can use in your keymap is actually spread out in a few different places:
* [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes.
* [quantum/quantum_keycodes.h](quantum/quantum_keycodes.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 `quantum_keycodes.h` is where they're actually defined.
* The [TMK documentation](doc/TMK_README.md). QMK is based on TMK, and this explains how it works internally.

@ -89,9 +89,9 @@ DEBUG_HOST = localhost
#============================================================================ #============================================================================
# Autodecct teensy loader # Autodecct teensy loader
ifneq (, $(shell which teensy-loader-cli 2>/dev/null)) ifneq (, $(shell which teensy-loader-cli 2>/dev/null))
TEENSY_LOADER_CLI = teensy-loader-cli TEENSY_LOADER_CLI ?= teensy-loader-cli
else else
TEENSY_LOADER_CLI = teensy_loader_cli TEENSY_LOADER_CLI ?= teensy_loader_cli
endif endif
# Program the device. # Program the device.
@ -101,42 +101,46 @@ program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
teensy: $(BUILD_DIR)/$(TARGET).hex teensy: $(BUILD_DIR)/$(TARGET).hex
$(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex
BATCHISP ?= batchisp
flip: $(BUILD_DIR)/$(TARGET).hex flip: $(BUILD_DIR)/$(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f $(BATCHISP) -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0
DFU_PROGRAMMER ?= dfu-programmer
dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter
until dfu-programmer $(MCU) get bootloader-version; do\ until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
echo "Error: Bootloader not found. Trying again in 5s." ;\ echo "Error: Bootloader not found. Trying again in 5s." ;\
sleep 5 ;\ sleep 5 ;\
done done
ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) ifneq (, $(findstring 0.7, $(shell $(DFU_PROGRAMMER) --version 2>&1)))
dfu-programmer $(MCU) erase --force $(DFU_PROGRAMMER) $(MCU) erase --force
else else
dfu-programmer $(MCU) erase $(DFU_PROGRAMMER) $(MCU) erase
endif endif
dfu-programmer $(MCU) flash $(BUILD_DIR)/$(TARGET).hex $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex
dfu-programmer $(MCU) reset $(DFU_PROGRAMMER) $(MCU) reset
dfu-start: dfu-start:
dfu-programmer $(MCU) reset $(DFU_PROGRAMMER) $(MCU) reset
dfu-programmer $(MCU) start $(DFU_PROGRAMMER) $(MCU) start
flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
$(COPY) $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET)eep.hex $(COPY) $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase $(BATCHISP) -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(BUILD_DIR)/$(TARGET)eep.hex program $(BATCHISP) -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(BUILD_DIR)/$(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex $(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex
dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
dfu-programmer $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep
else else
dfu-programmer $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep
endif endif
dfu-programmer $(MCU) reset $(DFU_PROGRAMMER) $(MCU) reset
# Convert hex to bin. # Convert hex to bin.
flashbin: $(BUILD_DIR)/$(TARGET).hex flashbin: $(BUILD_DIR)/$(TARGET).hex

@ -151,5 +151,7 @@ endif
# List any extra directories to look for libraries here. # List any extra directories to look for libraries here.
EXTRALIBDIRS = $(RULESPATH)/ld EXTRALIBDIRS = $(RULESPATH)/ld
DFU_UTIL ?= dfu-util
dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
dfu-util $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin

@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "action_macro.h" #include "action_macro.h"
#include "action_util.h" #include "action_util.h"
#include "action.h" #include "action.h"
#include "wait.h"
#ifdef DEBUG_ACTION #ifdef DEBUG_ACTION
#include "debug.h" #include "debug.h"
@ -140,7 +141,6 @@ void process_record(keyrecord_t *record)
void process_action(keyrecord_t *record, action_t action) void process_action(keyrecord_t *record, action_t action)
{ {
bool do_release_oneshot = false;
keyevent_t event = record->event; keyevent_t event = record->event;
#ifndef NO_ACTION_TAPPING #ifndef NO_ACTION_TAPPING
uint8_t tap_count = record->tap.count; uint8_t tap_count = record->tap.count;
@ -152,6 +152,7 @@ void process_action(keyrecord_t *record, action_t action)
} }
#ifndef NO_ACTION_ONESHOT #ifndef NO_ACTION_ONESHOT
bool do_release_oneshot = false;
// notice we only clear the one shot layer if the pressed key is not a modifier. // notice we only clear the one shot layer if the pressed key is not a modifier.
if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) { if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) {
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
@ -438,6 +439,9 @@ void process_action(keyrecord_t *record, action_t action)
} else { } else {
if (tap_count > 0) { if (tap_count > 0) {
dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n"); dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n");
if (action.layer_tap.code == KC_CAPS) {
wait_ms(80);
}
unregister_code(action.layer_tap.code); unregister_code(action.layer_tap.code);
} else { } else {
dprint("KEYMAP_TAP_KEY: No tap: Off on release\n"); dprint("KEYMAP_TAP_KEY: No tap: Off on release\n");
@ -537,6 +541,21 @@ void process_action(keyrecord_t *record, action_t action)
break; break;
} }
#ifndef NO_ACTION_LAYER
// if this event is a layer action, update the leds
switch (action.kind.id) {
case ACT_LAYER:
#ifndef NO_ACTION_TAPPING
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
#endif
led_set(host_keyboard_leds());
break;
default:
break;
}
#endif
#ifndef NO_ACTION_ONESHOT #ifndef NO_ACTION_ONESHOT
/* Because we switch layers after a oneshot event, we need to release the /* Because we switch layers after a oneshot event, we need to release the
* key before we leave the layer or no key up event will be generated. * key before we leave the layer or no key up event will be generated.

@ -58,9 +58,13 @@ void set_oneshot_locked_mods(int8_t mods) { oneshot_locked_mods = mods; }
void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; } void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; }
#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
static int16_t oneshot_time = 0; static int16_t oneshot_time = 0;
inline bool has_oneshot_mods_timed_out() { bool has_oneshot_mods_timed_out(void) {
return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT;
} }
#else
bool has_oneshot_mods_timed_out(void) {
return false;
}
#endif #endif
#endif #endif

@ -9,6 +9,7 @@
#include "suspend.h" #include "suspend.h"
#include "timer.h" #include "timer.h"
#include "led.h" #include "led.h"
#include "host.h"
#ifdef PROTOCOL_LUFA #ifdef PROTOCOL_LUFA
#include "lufa.h" #include "lufa.h"

@ -61,23 +61,51 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# include "visualizer/visualizer.h" # include "visualizer/visualizer.h"
#endif #endif
#ifdef MATRIX_HAS_GHOST
extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata){
matrix_row_t out = 0;
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
//read each key in the row data and check if the keymap defines it as a real key
if (pgm_read_byte(&keymaps[0][row][col]) && (rowdata & (1<<col))){
//this creates new row data, if a key is defined in the keymap, it will be set here
out |= 1<<col;
}
}
return out;
}
static inline bool popcount_more_than_one(matrix_row_t rowdata)
{
rowdata &= rowdata-1; //if there are less than two bits (keys) set, rowdata will become zero
return rowdata;
}
#ifdef MATRIX_HAS_GHOST static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata)
static bool has_ghost_in_row(uint8_t row)
{ {
matrix_row_t matrix_row = matrix_get_row(row); /* No ghost exists when less than 2 keys are down on the row.
// No ghost exists when less than 2 keys are down on the row If there are "active" blanks in the matrix, the key can't be pressed by the user,
if (((matrix_row - 1) & matrix_row) == 0) there is no doubt as to which keys are really being pressed.
The ghosts will be ignored, they are KC_NO. */
rowdata = get_real_keys(row, rowdata);
if ((popcount_more_than_one(rowdata)) == 0){
return false; return false;
}
// Ghost occurs when the row shares column line with other row /* Ghost occurs when the row shares a column line with other row,
and two columns are read on each row. Blanks in the matrix don't matter,
so they are filtered out.
If there are two or more real keys pressed and they match columns with
at least two of another row's real keys, the row will be ignored. Keep in mind,
we are checking one row at a time, not all of them at once.
*/
for (uint8_t i=0; i < MATRIX_ROWS; i++) { for (uint8_t i=0; i < MATRIX_ROWS; i++) {
if (i != row && (matrix_get_row(i) & matrix_row)) if (i != row && popcount_more_than_one(get_real_keys(i, matrix_get_row(i)) & rowdata)){
return true; return true;
} }
}
return false; return false;
} }
#endif #endif
__attribute__ ((weak)) __attribute__ ((weak))
@ -127,7 +155,7 @@ void keyboard_task(void)
{ {
static matrix_row_t matrix_prev[MATRIX_ROWS]; static matrix_row_t matrix_prev[MATRIX_ROWS];
#ifdef MATRIX_HAS_GHOST #ifdef MATRIX_HAS_GHOST
static matrix_row_t matrix_ghost[MATRIX_ROWS]; // static matrix_row_t matrix_ghost[MATRIX_ROWS];
#endif #endif
static uint8_t led_status = 0; static uint8_t led_status = 0;
matrix_row_t matrix_row = 0; matrix_row_t matrix_row = 0;
@ -139,18 +167,18 @@ void keyboard_task(void)
matrix_change = matrix_row ^ matrix_prev[r]; matrix_change = matrix_row ^ matrix_prev[r];
if (matrix_change) { if (matrix_change) {
#ifdef MATRIX_HAS_GHOST #ifdef MATRIX_HAS_GHOST
if (has_ghost_in_row(r)) { if (has_ghost_in_row(r, matrix_row)) {
/* Keep track of whether ghosted status has changed for /* Keep track of whether ghosted status has changed for
* debugging. But don't update matrix_prev until un-ghosted, or * debugging. But don't update matrix_prev until un-ghosted, or
* the last key would be lost. * the last key would be lost.
*/ */
if (debug_matrix && matrix_ghost[r] != matrix_row) { //if (debug_matrix && matrix_ghost[r] != matrix_row) {
matrix_print(); // matrix_print();
} //}
matrix_ghost[r] = matrix_row; //matrix_ghost[r] = matrix_row;
continue; continue;
} }
matrix_ghost[r] = matrix_row; //matrix_ghost[r] = matrix_row;
#endif #endif
if (debug_matrix) matrix_print(); if (debug_matrix) matrix_print();
for (uint8_t c = 0; c < MATRIX_COLS; c++) { for (uint8_t c = 0; c < MATRIX_COLS; c++) {

@ -57,7 +57,6 @@ static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) &&
.time = (timer_read() | 1) \ .time = (timer_read() | 1) \
} }
/* it runs once at early stage of startup before keyboard_init. */ /* it runs once at early stage of startup before keyboard_init. */
void keyboard_setup(void); void keyboard_setup(void);
/* it runs once after initializing host side protocol, debug and MCU peripherals. */ /* it runs once after initializing host side protocol, debug and MCU peripherals. */

@ -23,8 +23,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* max value on report descriptor */ /* max value on report descriptor */
#ifndef MOUSEKEY_MOVE_MAX
#define MOUSEKEY_MOVE_MAX 127 #define MOUSEKEY_MOVE_MAX 127
#elif MOUSEKEY_MOVE_MAX > 127
#error MOUSEKEY_MOVE_MAX needs to be smaller than 127
#endif
#ifndef MOUSEKEY_WHEEL_MAX
#define MOUSEKEY_WHEEL_MAX 127 #define MOUSEKEY_WHEEL_MAX 127
#elif MOUSEKEY_WHEEL_MAX > 127
#error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
#endif
#ifndef MOUSEKEY_MOVE_DELTA #ifndef MOUSEKEY_MOVE_DELTA
#define MOUSEKEY_MOVE_DELTA 5 #define MOUSEKEY_MOVE_DELTA 5

@ -92,6 +92,9 @@ endif
endif endif
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CFLAGS += -Werror
endif
#CFLAGS += -mshort-calls #CFLAGS += -mshort-calls
#CFLAGS += -fno-unit-at-a-time #CFLAGS += -fno-unit-at-a-time
#CFLAGS += -Wundef #CFLAGS += -Wundef
@ -115,6 +118,9 @@ CPPFLAGS += -O$(OPT)
CPPFLAGS += -w CPPFLAGS += -w
CPPFLAGS += -Wall CPPFLAGS += -Wall
CPPFLAGS += -Wundef CPPFLAGS += -Wundef
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CPPFLAGS += -Werror
endif
#CPPFLAGS += -mshort-calls #CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time #CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes #CPPFLAGS += -Wstrict-prototypes

@ -1 +0,0 @@
<html><head><meta http-equiv="refresh" content="0; url=http://qmk.fm/keyboards/ergodox/" /></head></html>

@ -33,18 +33,19 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
make ergodox-ez AUTOGEN=true make ergodox-ez AUTOGEN=true
find . -name ".build" | xargs rm -rf
cd .. cd ..
git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git
cd qmk.fm cd qmk.fm
git submodule update --init --recursive #git submodule update --init --recursive
#rm -rf keyboard #rm -rf keyboard
#rm -rf keyboards #rm -rf keyboards
yes | cp -rf ../qmk_firmware/keyboards . #yes | cp -rf ../qmk_firmware/keyboards .
#mkdir keyboards/ergodox_ez/ #mkdir keyboards/ergodox_ez/
cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html #cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html
cp ../qmk_firmware/readme.md qmk_readme.md #cp ../qmk_firmware/readme.md qmk_readme.md
./generate.sh #./generate.sh
rm -f _compiled/*.hex
for file in ../qmk_firmware/keyboards/*/keymaps/*/*.hex; do mv -v "$file" "_compiled/${file##*/}"; done
git add -A git add -A
git commit -m "generated from qmk/qmk_firmware@${rev}" git commit -m "generated from qmk/qmk_firmware@${rev}"

Loading…
Cancel
Save