commit
b7b94bfb13
10
.travis.yml
10
.travis.yml
|
@ -2,7 +2,6 @@ os: linux
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
language: c
|
language: c
|
||||||
compiler: avr-gcc
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- /^.*-automated-build$/
|
- /^.*-automated-build$/
|
||||||
|
@ -12,13 +11,18 @@ env:
|
||||||
matrix:
|
matrix:
|
||||||
- TARGET=all-keyboards AUTOGEN=true
|
- TARGET=all-keyboards AUTOGEN=true
|
||||||
- TARGET=test AUTOGEN=false
|
- TARGET=test AUTOGEN=false
|
||||||
|
before_install:
|
||||||
|
- wget http://www.atmel.com/images/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||||
|
install:
|
||||||
|
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
|
||||||
|
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
|
||||||
|
before_script:
|
||||||
|
- avr-gcc --version
|
||||||
script:
|
script:
|
||||||
- make $TARGET AUTOGEN=$AUTOGEN
|
- make $TARGET AUTOGEN=$AUTOGEN
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- avr-libc
|
|
||||||
- gcc-avr
|
|
||||||
- dfu-programmer
|
- dfu-programmer
|
||||||
- pandoc
|
- pandoc
|
||||||
- gcc-arm-none-eabi
|
- gcc-arm-none-eabi
|
||||||
|
|
|
@ -221,7 +221,11 @@ OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||||
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
||||||
|
|
||||||
ifeq ($(PLATFORM),AVR)
|
ifeq ($(PLATFORM),AVR)
|
||||||
|
ifeq ($(strip $(PROTOCOL)), VUSB)
|
||||||
|
include $(TMK_PATH)/protocol/vusb.mk
|
||||||
|
else
|
||||||
include $(TMK_PATH)/protocol/lufa.mk
|
include $(TMK_PATH)/protocol/lufa.mk
|
||||||
|
endif
|
||||||
include $(TMK_PATH)/avr.mk
|
include $(TMK_PATH)/avr.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboar
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Download or clone the whole firmware and navigate to the keyboards/planck 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.
|
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.
|
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define RGBLIGHT_SAT_STEP 255
|
#define RGBLIGHT_SAT_STEP 255
|
||||||
#define RGBLIGHT_VAL_STEP 12
|
#define RGBLIGHT_VAL_STEP 12
|
||||||
|
|
||||||
#define RGB_MIDI
|
// #define RGB_MIDI
|
||||||
#define RGBW_BB_TWI
|
#define RGBW_BB_TWI
|
||||||
|
|
||||||
#define RGBW 1
|
#define RGBW 1
|
||||||
|
|
|
@ -52,9 +52,9 @@ uint8_t init_mcp23018(void) {
|
||||||
|
|
||||||
// I2C subsystem
|
// I2C subsystem
|
||||||
|
|
||||||
uint8_t sreg_prev;
|
// uint8_t sreg_prev;
|
||||||
sreg_prev=SREG;
|
// sreg_prev=SREG;
|
||||||
cli();
|
// cli();
|
||||||
if (i2c_initialized == 0) {
|
if (i2c_initialized == 0) {
|
||||||
i2c_init(); // on pins D(1,0)
|
i2c_init(); // on pins D(1,0)
|
||||||
i2c_initialized++;
|
i2c_initialized++;
|
||||||
|
@ -83,7 +83,7 @@ uint8_t init_mcp23018(void) {
|
||||||
out:
|
out:
|
||||||
i2c_stop();
|
i2c_stop();
|
||||||
|
|
||||||
SREG=sreg_prev;
|
// SREG=sreg_prev;
|
||||||
|
|
||||||
return mcp23018_status;
|
return mcp23018_status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,18 +7,23 @@ Layers
|
||||||
------
|
------
|
||||||
|
|
||||||
* BASE: this is where you type.
|
* BASE: this is where you type.
|
||||||
|
* SHELL_LAYER: this is a permanent layer which I use when I don't need the F keys and gives me bash shortcuts on the top row.
|
||||||
* SHELL_NAV: hold down the Tab key to access shell/terminal navigation shorcuts such as forward/backward word, history, Ctrl+C, screen tab movement.
|
* SHELL_NAV: hold down the Tab key to access shell/terminal navigation shorcuts such as forward/backward word, history, Ctrl+C, screen tab movement.
|
||||||
* KEY_NAV: arrow key movement with backward/forward word support, and copy/paste.
|
* KEY_NAV: arrow key movement with backward/forward word support, and copy/paste.
|
||||||
* KEY_SEL: same as above, but every movement shift-selects.
|
* KEY_SEL: same as above, but every movement shift-selects.
|
||||||
* NUMBER: keypad layer.
|
* NUMBER: keypad layer.
|
||||||
* SYMBOL: all the symbols.
|
* SYMBOL: all the symbols.
|
||||||
* BRACKET: special brackets-only layer for programming
|
* BRACKET: special brackets-only layer for programming. Activated by pressing left capslock (OSL)
|
||||||
* SHORTCUTS: sends Hyper keys for Autohotkey to interpret. I use this to switch between specific apps.
|
* SHORTCUTS: sends Hyper keys for Autohotkey to interpret. I use this to switch between specific apps.
|
||||||
* MOUSE: use mouse keys
|
* MOUSE: use mouse keys
|
||||||
|
|
||||||
Updates
|
Updates
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
2017/01/22:
|
||||||
|
* Made brackets toggle an OSL on the left capslock
|
||||||
|
* Added SHELL_LAYER
|
||||||
|
|
||||||
2016/12/10:
|
2016/12/10:
|
||||||
* toggle for brackets layer is now on left thumb cluster.
|
* toggle for brackets layer is now on left thumb cluster.
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
#include "action_code.h"
|
#include "action_code.h"
|
||||||
|
|
||||||
#define BASE 0 // default layer
|
#define BASE 0 // default layer
|
||||||
#define SHELL_NAV 1
|
#define SHELL_LAYER 1
|
||||||
|
#define SHELL_NAV 2
|
||||||
#define KEY_NAV 3 // key navigation layer
|
#define KEY_NAV 3 // key navigation layer
|
||||||
#define KEY_SEL 4 // key selection layer
|
#define KEY_SEL 4 // key selection layer
|
||||||
#define NUMBER 5 // number layer
|
#define NUMBER 5 // number layer
|
||||||
|
@ -58,12 +59,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[BASE] = KEYMAP( // layer 0 : default
|
[BASE] = KEYMAP( // layer 0 : default
|
||||||
// left hand
|
// left hand
|
||||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||||
LT(MOUSE,KC_TAB), KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(KEY_SEL),
|
LT(SHELL_NAV,KC_TAB), KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, MO(KEY_SEL),
|
||||||
MO(SHELL_NAV), KC_A, KC_O, KC_E, KC_U, KC_I,
|
OSL(BRACKETS), KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||||
KC_FN3, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(KEY_NAV),
|
OSM(MOD_LSFT), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(KEY_NAV),
|
||||||
OSL(SHORTCUTS),KC_FN4, KC_FN5,OSL(SYMBOL),MO(NUMBER),
|
OSL(SHORTCUTS),KC_FN4, KC_FN5,OSL(SYMBOL),MO(NUMBER),
|
||||||
// thumb cluster
|
// thumb cluster
|
||||||
MO(BRACKETS), RCTL(KC_S),
|
MO(MOUSE), RCTL(KC_S),
|
||||||
RCTL(KC_DEL),
|
RCTL(KC_DEL),
|
||||||
KC_BSPC,RCTL(KC_BSPC),KC_DEL,
|
KC_BSPC,RCTL(KC_BSPC),KC_DEL,
|
||||||
// right hand
|
// right hand
|
||||||
|
@ -80,6 +81,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// permanent shell layer - meant to be used while in a terminal. only the top keys are overriden
|
||||||
|
[SHELL_LAYER] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,LALT(KC_DOT),RCTL(KC_R),RCTL(KC_C),
|
||||||
|
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,
|
||||||
|
// bottom row
|
||||||
|
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
|
// thumb cluster
|
||||||
|
KC_TRNS,KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
|
// right hand
|
||||||
|
RCTL(KC_W), LALT(KC_B),LALT(KC_F), KC_LEFT, KC_RIGHT, LALT(KC_D), 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,
|
||||||
|
// bottom row
|
||||||
|
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
|
// thumb cluster
|
||||||
|
KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
|
||||||
// shell navigation layer
|
// shell navigation layer
|
||||||
[SHELL_NAV] = KEYMAP(
|
[SHELL_NAV] = KEYMAP(
|
||||||
// left hand
|
// left hand
|
||||||
|
@ -210,9 +238,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[BRACKETS] = KEYMAP(
|
[BRACKETS] = KEYMAP(
|
||||||
// left hand
|
// left 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,M(OPEN_CLOSE_CURLY), M(OPEN_CLOSE_PAREN),M(OPEN_CLOSE_BRACKET), KC_TRNS,KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_TRNS,KC_TRNS, KC_LCBR, KC_RCBR, 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,
|
||||||
|
@ -246,7 +274,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
MEH(KC_S), MEH(KC_T), MEH(KC_U), MEH(KC_V), MEH(KC_X),
|
MEH(KC_S), MEH(KC_T), MEH(KC_U), MEH(KC_V), MEH(KC_X),
|
||||||
MEH(KC_6), MEH(KC_7),
|
MEH(KC_6), MEH(KC_7),
|
||||||
MEH(KC_8),
|
MEH(KC_8),
|
||||||
MEH(KC_9), MEH(KC_Y), MEH(KC_Z)
|
MEH(KC_9), TO(BASE), TO(SHELL_LAYER)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,6 +434,8 @@ void matrix_scan_user(void) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case NUMBER:
|
case NUMBER:
|
||||||
case SYMBOL:
|
case SYMBOL:
|
||||||
|
case BRACKETS:
|
||||||
|
//case SHELL_LAYER:
|
||||||
ergodox_right_led_2_on();
|
ergodox_right_led_2_on();
|
||||||
break;
|
break;
|
||||||
case KEY_NAV:
|
case KEY_NAV:
|
||||||
|
|
|
@ -0,0 +1,419 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backcolor": "#ffffff",
|
||||||
|
"name": "Ergodox Swiss German Layout - Base Layer",
|
||||||
|
"author": "Andreas Schmidt (https://github.com/remigius42)"
|
||||||
|
},
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 3.5
|
||||||
|
},
|
||||||
|
"#\n3",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"*\n8"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"@\n2",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"$\n4",
|
||||||
|
{
|
||||||
|
"x": 8.5
|
||||||
|
},
|
||||||
|
"&\n7",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"(\n9"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5
|
||||||
|
},
|
||||||
|
"%\n5",
|
||||||
|
{
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-left'></i>",
|
||||||
|
{
|
||||||
|
"x": 4.5
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-right'></i>",
|
||||||
|
{
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"^\n6"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"°\n§",
|
||||||
|
"!\n1",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
")\n0",
|
||||||
|
{
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"?\n'\n\n'"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5
|
||||||
|
},
|
||||||
|
"E",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"I"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"W",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"R",
|
||||||
|
{
|
||||||
|
"x": 8.5
|
||||||
|
},
|
||||||
|
"U",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"O"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5
|
||||||
|
},
|
||||||
|
"T",
|
||||||
|
{
|
||||||
|
"c": "#b56b6b",
|
||||||
|
"a": 6,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"Toggle Code Layer",
|
||||||
|
{
|
||||||
|
"x": 4.5,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"Toggle Code Layer",
|
||||||
|
{
|
||||||
|
"c": "#cccccc",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"Y"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"a": 6,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"Delete",
|
||||||
|
{
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"Q",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"P",
|
||||||
|
{
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"è\nü\n\n["
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5
|
||||||
|
},
|
||||||
|
"D",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"K"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"S",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"F",
|
||||||
|
{
|
||||||
|
"x": 8.5
|
||||||
|
},
|
||||||
|
"J",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"L"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5
|
||||||
|
},
|
||||||
|
"G",
|
||||||
|
{
|
||||||
|
"x": 6.5
|
||||||
|
},
|
||||||
|
"H"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"a": 6,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"Backspace",
|
||||||
|
{
|
||||||
|
"c": "#79c777",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"A\n\nLyr3",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"é\nö\nLyr3",
|
||||||
|
{
|
||||||
|
"c": "#748adb",
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"à\nä\nCmd\n{"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.625,
|
||||||
|
"x": 6.5,
|
||||||
|
"c": "#cccccc",
|
||||||
|
"a": 6,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"Hyper",
|
||||||
|
{
|
||||||
|
"x": 4.5,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"Meh"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.75,
|
||||||
|
"x": 3.5,
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"C",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
";\n,"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5,
|
||||||
|
"c": "#748adb"
|
||||||
|
},
|
||||||
|
"X\n\nAlt",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"c": "#cccccc"
|
||||||
|
},
|
||||||
|
"V",
|
||||||
|
{
|
||||||
|
"x": 8.5
|
||||||
|
},
|
||||||
|
"M",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"c": "#748adb"
|
||||||
|
},
|
||||||
|
":\n.\nAlt"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5,
|
||||||
|
"c": "#cccccc"
|
||||||
|
},
|
||||||
|
"B",
|
||||||
|
{
|
||||||
|
"x": 6.5
|
||||||
|
},
|
||||||
|
"N"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"a": 6,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"Shift",
|
||||||
|
{
|
||||||
|
"c": "#748adb",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"Z\n\nCtrl",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"_\n-\nCtrl",
|
||||||
|
{
|
||||||
|
"c": "#cccccc",
|
||||||
|
"a": 6,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"Shift"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5,
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-left'></i>",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-down'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5,
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"£\n$\n\n}",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-right'></i>",
|
||||||
|
{
|
||||||
|
"x": 10.5,
|
||||||
|
"a": 6
|
||||||
|
},
|
||||||
|
"AltGr"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.9950000000000001,
|
||||||
|
"x": 14,
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-up'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.7549999999999999,
|
||||||
|
"x": 0.5,
|
||||||
|
"c": "#b56b6b",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
">\n<\nCode Layer\n\\",
|
||||||
|
{
|
||||||
|
"c": "#cccccc"
|
||||||
|
},
|
||||||
|
"`\n^\n\n~",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"!\n¨\n\n]",
|
||||||
|
{
|
||||||
|
"c": "#b56b6b"
|
||||||
|
},
|
||||||
|
"\n\nCode Layer"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"r": 30,
|
||||||
|
"rx": 6.5,
|
||||||
|
"ry": 4.25,
|
||||||
|
"y": -1,
|
||||||
|
"x": 1,
|
||||||
|
"c": "#748adb"
|
||||||
|
},
|
||||||
|
"Apps\nAlt",
|
||||||
|
{
|
||||||
|
"c": "#cccccc",
|
||||||
|
"a": 6
|
||||||
|
},
|
||||||
|
"Win / Cmd"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"Space",
|
||||||
|
{
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"Back Space",
|
||||||
|
"Home"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 2
|
||||||
|
},
|
||||||
|
"End"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"r": -30,
|
||||||
|
"rx": 13,
|
||||||
|
"y": -1,
|
||||||
|
"x": -3
|
||||||
|
},
|
||||||
|
"Alt",
|
||||||
|
{
|
||||||
|
"c": "#748adb",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"Esc\nCtrl"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -3,
|
||||||
|
"c": "#cccccc",
|
||||||
|
"a": 6
|
||||||
|
},
|
||||||
|
"Pg Up",
|
||||||
|
{
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"Tab",
|
||||||
|
{
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"Enter"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -3
|
||||||
|
},
|
||||||
|
"Pg Dn"
|
||||||
|
]
|
||||||
|
]
|
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
|
@ -0,0 +1,436 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backcolor": "#ffffff",
|
||||||
|
"name": "Ergodox Swiss German Layout - Symbol & Media Layer",
|
||||||
|
"author": "Andreas Schmidt (https://github.com/remigius42)"
|
||||||
|
},
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 3.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"F3",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"F8"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"F2",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"F4",
|
||||||
|
{
|
||||||
|
"x": 8.5
|
||||||
|
},
|
||||||
|
"F7",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"F9"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5
|
||||||
|
},
|
||||||
|
"F5",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"x": 4.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"F6"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"\n\n\nFlash",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"F1",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"F10",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c\n\n\n#529151",
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"F11\n\n\nFlash"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5
|
||||||
|
},
|
||||||
|
"{\n\n\n<i class='fa fa-arrow-circle-up'></i>",
|
||||||
|
{
|
||||||
|
"x": 10.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"8"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"@",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"}",
|
||||||
|
{
|
||||||
|
"x": 8.5,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
"7\n\n\nHTML ul",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"9\n\n\nHTML ol"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"|",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"x": 4.5,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-up'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"!",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"*",
|
||||||
|
{
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"F12"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
"(\n\n\n<i class='fa fa-arrow-circle-down'></i>",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"5\n\n\nHTML li"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5
|
||||||
|
},
|
||||||
|
"$\n\n\n<i class='fa fa-arrow-circle-left'></i>",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
")\n\n\n<i class='fa fa-arrow-circle-right'></i>",
|
||||||
|
{
|
||||||
|
"x": 8.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"4",
|
||||||
|
{
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"6"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5
|
||||||
|
},
|
||||||
|
"`",
|
||||||
|
{
|
||||||
|
"x": 6.5
|
||||||
|
},
|
||||||
|
"<i class='fa fa-arrow-down'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"#",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"+",
|
||||||
|
{
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"\n\n\n<i class='fa fa-play'></i><i class='fa fa-pause'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.625,
|
||||||
|
"x": 6.5,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"x": 4.5,
|
||||||
|
"h": 1.5
|
||||||
|
},
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.75,
|
||||||
|
"x": 3.5,
|
||||||
|
"t": "#b81c1c\n\n\n#529151",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"[\n\n\nHTML code",
|
||||||
|
{
|
||||||
|
"x": 10.5
|
||||||
|
},
|
||||||
|
"2\n\n\n<i class='fa fa-fast-backward'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"^",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
"]\n\n\nHTML br",
|
||||||
|
{
|
||||||
|
"x": 8.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"1",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
"3\n\n\n<i class='fa fa-fast-forward'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 5.5,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"~",
|
||||||
|
{
|
||||||
|
"x": 6.5
|
||||||
|
},
|
||||||
|
"&"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"%",
|
||||||
|
{
|
||||||
|
"x": 14.5
|
||||||
|
},
|
||||||
|
"\\",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"w": 1.5
|
||||||
|
},
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.375,
|
||||||
|
"x": 3.5,
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"\n\n\nleft click",
|
||||||
|
{
|
||||||
|
"x": 10.5,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
".\n\n\n<i class='fa fa-volume-down'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.875,
|
||||||
|
"x": 2.5,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"\n\n\nright click",
|
||||||
|
{
|
||||||
|
"x": 8.5,
|
||||||
|
"t": "#b81c1c\n\n\n#529151"
|
||||||
|
},
|
||||||
|
"?\n\n\n<i class='fa fa-volume-up'></i>",
|
||||||
|
{
|
||||||
|
"x": 1,
|
||||||
|
"t": "#b81c1c"
|
||||||
|
},
|
||||||
|
"0"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"y": -0.75,
|
||||||
|
"x": 0.5,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#b81c1c",
|
||||||
|
"a": 4
|
||||||
|
},
|
||||||
|
"EPRM RST",
|
||||||
|
{
|
||||||
|
"x": 14.5,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"r": 30,
|
||||||
|
"rx": 6.5,
|
||||||
|
"ry": 4.25,
|
||||||
|
"y": -1,
|
||||||
|
"x": 1
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"a": 4,
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"\n\n\nEnter",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7,
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": 2
|
||||||
|
},
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"r": -30,
|
||||||
|
"rx": 13,
|
||||||
|
"y": -1,
|
||||||
|
"x": -3
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -3
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"t": "#000000\n\n\n#529151",
|
||||||
|
"a": 4,
|
||||||
|
"h": 2
|
||||||
|
},
|
||||||
|
"\n\n\nWeb back"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"x": -3,
|
||||||
|
"t": "#000000",
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
""
|
||||||
|
]
|
||||||
|
]
|
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
|
@ -0,0 +1,287 @@
|
||||||
|
#include "ergodox.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
|
#ifdef SUBPROJECT_infinity
|
||||||
|
#include "visualizer/lcd_backlight.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define BASE 0 // default layer
|
||||||
|
#define SYMB 1 // symbols
|
||||||
|
#define MDIA 2 // media keys
|
||||||
|
|
||||||
|
#define EPRM M(1) // Macro 1: Reset EEPROM
|
||||||
|
#define HTML_LI M(10)
|
||||||
|
#define HTML_UL M(11)
|
||||||
|
#define HTML_OL M(12)
|
||||||
|
#define HTML_CODE M(13)
|
||||||
|
#define HTML_BR M(14)
|
||||||
|
|
||||||
|
#define SEND_TAG(TAG) do {\
|
||||||
|
send_key(KC_NONUS_BSLASH); \
|
||||||
|
SEND_STRING(TAG); \
|
||||||
|
send_larger_than(); \
|
||||||
|
send_key(KC_NONUS_BSLASH); \
|
||||||
|
SEND_STRING("&"); \
|
||||||
|
SEND_STRING(TAG); \
|
||||||
|
send_larger_than(); \
|
||||||
|
go_back_based_on_tag(TAG); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define SEND_SHORT_TAG(TAG) do {\
|
||||||
|
send_key(KC_NONUS_BSLASH); \
|
||||||
|
SEND_STRING(TAG); \
|
||||||
|
SEND_STRING("&"); \
|
||||||
|
send_larger_than(); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
void send_key(uint16_t keycode);
|
||||||
|
void go_back_based_on_tag(char* tag);
|
||||||
|
void send_larger_than(void);
|
||||||
|
|
||||||
|
|
||||||
|
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 | ' |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | Del | Q | W | E | R | T | L1 | | L1 | Z | U | I | O | P | ü |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | BkSp | A /L2| S | D | F | G |------| |------| H | J | K | L |ö / L2|ä / Cmd |
|
||||||
|
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
|
||||||
|
* | LShift |Y/Ctrl|X/Alt | C | V | B | | | | N | M | , |./Alt |-/Ctrl| RShift |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* |< / L1| ^ | $ | Left | Right| | Up | Down |AltGr | ¨ | ~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
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||||
|
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||||
|
KC_BSPC, LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G,
|
||||||
|
KC_LSFT, CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||||
|
LT(SYMB,KC_NONUS_BSLASH), KC_EQL, KC_BSLS, 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_MINS,
|
||||||
|
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||||
|
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
|
||||||
|
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT,
|
||||||
|
KC_UP, KC_DOWN,KC_RALT,KC_RBRC, KC_FN1,
|
||||||
|
KC_LALT,CTL_T(KC_ESC),
|
||||||
|
KC_PGUP,
|
||||||
|
KC_PGDN,KC_TAB, KC_ENT
|
||||||
|
),
|
||||||
|
/* Keymap 1: Symbol Layer
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | | EPRM | | | | | ? | . | 0 | = | |
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | | |------| |------| | |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
// SYMBOLS
|
||||||
|
[SYMB] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||||
|
KC_TRNS,ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), ACTION_MODS_KEY(MOD_RALT, KC_2), ACTION_MODS_KEY(MOD_RALT, KC_QUOT), ACTION_MODS_KEY(MOD_RALT, KC_BSLS),ACTION_MODS_KEY(MOD_RALT,KC_7),KC_TRNS,
|
||||||
|
KC_TRNS,ACTION_MODS_KEY(MOD_RALT,KC_3),KC_BSLS, ACTION_MODS_KEY(MOD_LSFT, KC_8), ACTION_MODS_KEY(MOD_RSFT, KC_9),ACTION_MODS_KEY(MOD_LSFT,KC_EQL),
|
||||||
|
KC_TRNS,ACTION_MODS_KEY(MOD_LSFT,KC_5),KC_EQL, ACTION_MODS_KEY(MOD_RALT, KC_LBRC), ACTION_MODS_KEY(MOD_RALT, KC_RBRC),ACTION_MODS_KEY(MOD_RALT,KC_EQL),KC_TRNS,
|
||||||
|
KC_TRNS,EPRM,KC_TRNS,KC_NONUS_BSLASH, ACTION_MODS_KEY(MOD_LSFT, KC_NONUS_BSLASH)/*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, ACTION_MODS_KEY(MOD_RSFT,KC_3), KC_F12,
|
||||||
|
KC_DOWN, KC_4, KC_5, KC_6, ACTION_MODS_KEY(MOD_RSFT,KC_1), KC_TRNS,
|
||||||
|
KC_TRNS, ACTION_MODS_KEY(MOD_RSFT,KC_6), KC_1, KC_2, KC_3, ACTION_MODS_KEY(MOD_RALT,KC_NONUS_BSLASH), KC_TRNS,
|
||||||
|
ACTION_MODS_KEY(MOD_RSFT,KC_MINS),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
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | RESET | | | | | | | | | | | | | | RESET |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | | | MsUp | | | | | | |H_UL | |H_OL | | |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | |MsLeft|MsDown|MsRght| |------| |------| | | |H_LI | | Play |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | |H_CODE| |H_BR | | | | | | | Prev | Next | | |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* |Enter | | | | | |Brwser|
|
||||||
|
* | | |------| |------| |Back |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
// MEDIA AND MOUSE
|
||||||
|
[MDIA] = KEYMAP(
|
||||||
|
RESET, 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, HTML_CODE, KC_TRNS, HTML_BR, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||||
|
KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_ENT, KC_TRNS, KC_TRNS,
|
||||||
|
// right hand
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
|
||||||
|
KC_TRNS, KC_TRNS, HTML_UL, KC_TRNS, HTML_OL, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, HTML_LI, 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) {
|
||||||
|
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (record->event.pressed) { // For resetting EEPROM
|
||||||
|
eeconfig_init();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_TAG("li");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_TAG("ul");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_TAG("ol");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_TAG("code");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_SHORT_TAG("br");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
|
||||||
|
switch (layer) {
|
||||||
|
// TODO: Make this relevant to the ErgoDox EZ.
|
||||||
|
case 0:
|
||||||
|
ergodox_board_led_off();
|
||||||
|
ergodox_right_led_1_off();
|
||||||
|
ergodox_right_led_2_off();
|
||||||
|
ergodox_right_led_3_off();
|
||||||
|
|
||||||
|
#ifdef SUBPROJECT_infinity
|
||||||
|
lcd_backlight_hal_color(0, 0, 0);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ergodox_right_led_1_on();
|
||||||
|
|
||||||
|
ergodox_board_led_off();
|
||||||
|
ergodox_right_led_2_off();
|
||||||
|
ergodox_right_led_3_off();
|
||||||
|
#ifdef SUBPROJECT_infinity
|
||||||
|
lcd_backlight_hal_color(5000, 0, 0);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ergodox_right_led_2_on();
|
||||||
|
|
||||||
|
ergodox_board_led_off();
|
||||||
|
ergodox_right_led_1_off();
|
||||||
|
ergodox_right_led_3_off();
|
||||||
|
#ifdef SUBPROJECT_infinity
|
||||||
|
lcd_backlight_hal_color(0, 5000, 0);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// none
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void send_key(uint16_t keycode) {
|
||||||
|
register_code(keycode);
|
||||||
|
unregister_code(keycode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void go_back_based_on_tag(char* tag) {
|
||||||
|
const int BRACKETS_AND_SLASH_LENGTH = 3;
|
||||||
|
|
||||||
|
for (int i=0; i < strlen(tag) + BRACKETS_AND_SLASH_LENGTH; i++) {
|
||||||
|
send_key(KC_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void send_larger_than() {
|
||||||
|
register_code(KC_LSFT);
|
||||||
|
send_key(KC_NONUS_BSLASH);
|
||||||
|
unregister_code(KC_LSFT);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
# ErgoDox Swiss German Configuration
|
||||||
|
|
||||||
|
Swiss German keyboard layout based on the Ergodox EZ default layout.
|
||||||
|
|
||||||
|
Keyboard diagrams created with the [keyboard layout editor](http://www.keyboard-layout-editor.com).
|
||||||
|
|
||||||
|
Diagram sources: [default layer](keyboard-layout.json), [layer 1 & 2](keyboard-layout_1_2.json)
|
||||||
|
|
||||||
|
![Layout Layer 0](keyboard-layout.png)
|
||||||
|
![Layout Layer 1&2](keyboard-layout_1_2.png)
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
* Jan 21, 2017:
|
||||||
|
* Initial version based on default layout.
|
||||||
|
|
|
@ -15,3 +15,18 @@ 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 "infinity60.h"
|
#include "infinity60.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,3 +46,12 @@ const uint16_t fn_actions[] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
|
@ -80,3 +80,12 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
|
@ -111,3 +111,13 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
const uint16_t fn_actions[] = {
|
const uint16_t fn_actions[] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
|
@ -62,6 +62,8 @@ void matrix_init(void)
|
||||||
#endif
|
#endif
|
||||||
memset(matrix, 0, MATRIX_ROWS);
|
memset(matrix, 0, MATRIX_ROWS);
|
||||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t matrix_scan(void)
|
uint8_t matrix_scan(void)
|
||||||
|
@ -146,6 +148,7 @@ uint8_t matrix_scan(void)
|
||||||
}
|
}
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
}
|
}
|
||||||
|
matrix_scan_quantum();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,49 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "config_common.h"
|
#include "config_common.h"
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
|
||||||
#define VENDOR_ID 0xFEED
|
|
||||||
#define PRODUCT_ID 0x3060
|
|
||||||
#define DEVICE_VER 0x0001
|
|
||||||
#define MANUFACTURER Wootpatoot
|
|
||||||
#define PRODUCT Lets Split
|
|
||||||
#define DESCRIPTION A split keyboard for the cheap makers
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
|
||||||
#define DIODE_DIRECTION COL2ROW
|
|
||||||
|
|
||||||
/* define if matrix has ghost */
|
|
||||||
//#define MATRIX_HAS_GHOST
|
|
||||||
|
|
||||||
/* number of backlight levels */
|
|
||||||
// #define BACKLIGHT_LEVELS 3
|
|
||||||
|
|
||||||
/* Set 0 if debouncing isn't needed */
|
|
||||||
#define DEBOUNCING_DELAY 5
|
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
|
||||||
/* Locking resynchronize hack */
|
|
||||||
#define LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
/* key combination for command */
|
|
||||||
#define IS_COMMAND() ( \
|
|
||||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
#ifdef SUBPROJECT_rev1
|
#ifdef SUBPROJECT_rev1
|
||||||
#include "rev1/config.h"
|
#include "rev1/config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,188 +0,0 @@
|
||||||
#include "lets_split.h"
|
|
||||||
#include "action_layer.h"
|
|
||||||
#include "eeconfig.h"
|
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
|
||||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
||||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
||||||
// entirely and just use numbers.
|
|
||||||
#define _QWERTY 0
|
|
||||||
#define _COLEMAK 1
|
|
||||||
#define _DVORAK 2
|
|
||||||
#define _LOWER 3
|
|
||||||
#define _RAISE 4
|
|
||||||
#define _ADJUST 16
|
|
||||||
|
|
||||||
enum custom_keycodes {
|
|
||||||
QWERTY = SAFE_RANGE,
|
|
||||||
COLEMAK,
|
|
||||||
DVORAK,
|
|
||||||
LOWER,
|
|
||||||
RAISE,
|
|
||||||
ADJUST,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fillers to make layering more clear
|
|
||||||
#define _______ KC_TRNS
|
|
||||||
#define XXXXXXX KC_NO
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
|
|
||||||
/* Qwerty
|
|
||||||
* ,-----------------------------------------------------------------------------------.
|
|
||||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
||||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
||||||
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
|
||||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
||||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
||||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
||||||
* `-----------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
[_QWERTY] = KEYMAP( \
|
|
||||||
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_QUOT, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
|
|
||||||
KC_LCTL, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, MT(MOD_LSFT, KC_SPC), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* Colemak
|
|
||||||
* ,-----------------------------------------------------------------------------------.
|
|
||||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
|
||||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
||||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
|
||||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
||||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
||||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
||||||
* `-----------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
[_COLEMAK] = KEYMAP( \
|
|
||||||
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_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_ENT , \
|
|
||||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* Dvorak
|
|
||||||
* ,-----------------------------------------------------------------------------------.
|
|
||||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
|
||||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
||||||
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
|
||||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
||||||
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
||||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
||||||
* `-----------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
[_DVORAK] = KEYMAP( \
|
|
||||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
|
|
||||||
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
|
|
||||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
|
|
||||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
|
||||||
),
|
|
||||||
[3] = KEYMAP( \
|
|
||||||
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_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_BSPC, MT(MOD_LSFT, KC_BSPC), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
|
||||||
),
|
|
||||||
[4] = KEYMAP( \
|
|
||||||
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_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_ENT, MT(MOD_LSFT, KC_ENT), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* Adjust (Lower + Raise)
|
|
||||||
* ,-----------------------------------------------------------------------------------.
|
|
||||||
* | | Reset| | | | | | | | | | Del |
|
|
||||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
||||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
|
||||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
||||||
* | | | | | | | | | | | | |
|
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
||||||
* | | | | | | | | | | | |
|
|
||||||
* `-----------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
[_ADJUST] = KEYMAP( \
|
|
||||||
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
|
|
||||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
|
||||||
_______, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, _______, _______, _______, \
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLE
|
|
||||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
|
||||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
|
||||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void persistant_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
|
|
||||||
persistant_default_layer_set(1UL<<_QWERTY);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case COLEMAK:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
#ifdef AUDIO_ENABLE
|
|
||||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
|
||||||
#endif
|
|
||||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case DVORAK:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
#ifdef AUDIO_ENABLE
|
|
||||||
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
|
||||||
#endif
|
|
||||||
persistant_default_layer_set(1UL<<_DVORAK);
|
|
||||||
}
|
|
||||||
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 ADJUST:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
layer_on(_ADJUST);
|
|
||||||
} else {
|
|
||||||
layer_off(_ADJUST);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -14,89 +14,14 @@ GNU General Public License for more details.
|
||||||
You should have received a copy of the GNU General Public License
|
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 CONFIG_H
|
|
||||||
#define CONFIG_H
|
|
||||||
|
|
||||||
#include "config_common.h"
|
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
|
||||||
#define VENDOR_ID 0xFEED
|
|
||||||
#define PRODUCT_ID 0x3060
|
|
||||||
#define DEVICE_VER 0x0001
|
|
||||||
#define MANUFACTURER Wootpatoot
|
|
||||||
#define PRODUCT Lets Split
|
|
||||||
#define DESCRIPTION A split keyboard for the cheap makers
|
|
||||||
|
|
||||||
/* key matrix size */
|
|
||||||
// Rows are doubled-up
|
|
||||||
#define MATRIX_ROWS 8
|
|
||||||
#define MATRIX_COLS 6
|
|
||||||
|
|
||||||
// wiring of each half
|
|
||||||
#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
|
|
||||||
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
|
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
|
||||||
|
|
||||||
#define USE_I2C
|
#define USE_I2C
|
||||||
|
|
||||||
// Use serial if not using I2C
|
|
||||||
#ifndef USE_I2C
|
|
||||||
# define USE_SERIAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #define EE_HANDS
|
|
||||||
|
|
||||||
#define I2C_MASTER_LEFT
|
#define I2C_MASTER_LEFT
|
||||||
// #define I2C_MASTER_RIGHT
|
// #define I2C_MASTER_RIGHT
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
#ifdef SUBPROJECT_rev1
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#include "../../rev1/config.h"
|
||||||
|
#endif
|
||||||
/* define if matrix has ghost */
|
#ifdef SUBPROJECT_rev2
|
||||||
//#define MATRIX_HAS_GHOST
|
#include "../../rev2/config.h"
|
||||||
|
|
||||||
/* number of backlight levels */
|
|
||||||
// #define BACKLIGHT_LEVELS 3
|
|
||||||
|
|
||||||
/* Set 0 if debouncing isn't needed */
|
|
||||||
#define DEBOUNCING_DELAY 5
|
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
|
||||||
/* Locking resynchronize hack */
|
|
||||||
#define LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
/* key combination for command */
|
|
||||||
#define IS_COMMAND() ( \
|
|
||||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* ws2812 RGB LED */
|
|
||||||
#define RGB_DI_PIN D4
|
|
||||||
#define RGBLIGHT_ANIMATIONS
|
|
||||||
#define RGBLED_NUM 8 // Number of LEDs
|
|
||||||
#define RGBLIGHT_HUE_STEP 10
|
|
||||||
#define RGBLIGHT_SAT_STEP 17
|
|
||||||
#define RGBLIGHT_VAL_STEP 17
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Feature disable options
|
|
||||||
* These options are also useful to firmware size reduction.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* disable debug print */
|
|
||||||
// #define NO_DEBUG
|
|
||||||
|
|
||||||
/* disable print */
|
|
||||||
// #define NO_PRINT
|
|
||||||
|
|
||||||
/* disable action features */
|
|
||||||
//#define NO_ACTION_LAYER
|
|
||||||
//#define NO_ACTION_TAPPING
|
|
||||||
//#define NO_ACTION_ONESHOT
|
|
||||||
//#define NO_ACTION_MACRO
|
|
||||||
//#define NO_ACTION_FUNCTION
|
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -15,88 +15,15 @@ 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 CONFIG_H
|
|
||||||
#define CONFIG_H
|
|
||||||
|
|
||||||
#include "config_common.h"
|
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
|
||||||
#define VENDOR_ID 0xFEED
|
|
||||||
#define PRODUCT_ID 0x3060
|
|
||||||
#define DEVICE_VER 0x0001
|
|
||||||
#define MANUFACTURER Wootpatoot
|
|
||||||
#define PRODUCT Lets Split
|
|
||||||
#define DESCRIPTION A split keyboard for the cheap makers
|
|
||||||
|
|
||||||
/* key matrix size */
|
|
||||||
// Rows are doubled-up
|
|
||||||
#define MATRIX_ROWS 8
|
|
||||||
#define MATRIX_COLS 6
|
|
||||||
|
|
||||||
// wiring of each half
|
|
||||||
#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
|
|
||||||
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
|
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
|
||||||
|
|
||||||
// #define USE_I2C
|
|
||||||
|
|
||||||
// Use serial if not using I2C
|
|
||||||
#ifndef USE_I2C
|
|
||||||
#define USE_SERIAL
|
#define USE_SERIAL
|
||||||
|
|
||||||
|
#define EE_HANDS
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SUBPROJECT_rev1
|
||||||
|
#include "../../rev1/config.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SUBPROJECT_rev2
|
||||||
// #define EE_HANDS
|
#include "../../rev2/config.h"
|
||||||
|
|
||||||
#define I2C_MASTER_LEFT
|
|
||||||
// #define I2C_MASTER_RIGHT
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
|
||||||
#define DIODE_DIRECTION COL2ROW
|
|
||||||
|
|
||||||
/* define if matrix has ghost */
|
|
||||||
//#define MATRIX_HAS_GHOST
|
|
||||||
|
|
||||||
/* number of backlight levels */
|
|
||||||
// #define BACKLIGHT_LEVELS 3
|
|
||||||
|
|
||||||
/* Set 0 if debouncing isn't needed */
|
|
||||||
#define DEBOUNCING_DELAY 5
|
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
|
||||||
/* Locking resynchronize hack */
|
|
||||||
#define LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
/* key combination for command */
|
|
||||||
#define IS_COMMAND() ( \
|
|
||||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* ws2812 RGB LED */
|
|
||||||
#define RGB_DI_PIN D4
|
|
||||||
#define RGBLIGHT_ANIMATIONS
|
|
||||||
#define RGBLED_NUM 8 // Number of LEDs
|
|
||||||
#define RGBLIGHT_HUE_STEP 10
|
|
||||||
#define RGBLIGHT_SAT_STEP 17
|
|
||||||
#define RGBLIGHT_VAL_STEP 17
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Feature disable options
|
|
||||||
* These options are also useful to firmware size reduction.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* disable debug print */
|
|
||||||
// #define NO_DEBUG
|
|
||||||
|
|
||||||
/* disable print */
|
|
||||||
// #define NO_PRINT
|
|
||||||
|
|
||||||
/* disable action features */
|
|
||||||
//#define NO_ACTION_LAYER
|
|
||||||
//#define NO_ACTION_TAPPING
|
|
||||||
//#define NO_ACTION_ONESHOT
|
|
||||||
//#define NO_ACTION_MACRO
|
|
||||||
//#define NO_ACTION_FUNCTION
|
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define PRODUCT_ID 0x3060
|
#define PRODUCT_ID 0x3060
|
||||||
#define DEVICE_VER 0x0001
|
#define DEVICE_VER 0x0001
|
||||||
#define MANUFACTURER Wootpatoot
|
#define MANUFACTURER Wootpatoot
|
||||||
#define PRODUCT Lets Split
|
|
||||||
#define PRODUCT Lets Split v1
|
#define PRODUCT Lets Split v1
|
||||||
#define DESCRIPTION A split keyboard for the cheap makers
|
#define DESCRIPTION A split keyboard for the cheap makers
|
||||||
|
|
||||||
|
@ -37,20 +36,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// wiring of each half
|
// wiring of each half
|
||||||
#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
|
#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
|
||||||
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
|
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
|
||||||
|
// #define MATRIX_COL_PINS { B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order
|
||||||
|
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
#define CATERINA_BOOTLOADER
|
||||||
|
|
||||||
// #define USE_I2C
|
|
||||||
// Use serial if not using I2C
|
|
||||||
#ifndef USE_I2C
|
|
||||||
# define USE_SERIAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #define EE_HANDS
|
|
||||||
|
|
||||||
#define I2C_MASTER_LEFT
|
|
||||||
// #define I2C_MASTER_RIGHT
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
|
|
@ -36,21 +36,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// wiring of each half
|
// wiring of each half
|
||||||
#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
|
#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
|
||||||
#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
||||||
|
// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
#define CATERINA_BOOTLOADER
|
||||||
|
|
||||||
// #define USE_I2C
|
|
||||||
|
|
||||||
// Use serial if not using I2C
|
|
||||||
#ifndef USE_I2C
|
|
||||||
# define USE_SERIAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #define EE_HANDS
|
|
||||||
|
|
||||||
#define I2C_MASTER_LEFT
|
|
||||||
// #define I2C_MASTER_RIGHT
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
//void promicro_bootloader_jmp(bool program);
|
//void promicro_bootloader_jmp(bool program);
|
||||||
|
|
||||||
#define KEYMAP( \
|
#define KEYMAP( \
|
||||||
k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \
|
k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
|
||||||
k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \
|
k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
|
||||||
k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \
|
k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
|
||||||
k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \
|
k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
{ k00, k01, k02, k03, k04, k05 }, \
|
{ k00, k01, k02, k03, k04, k05 }, \
|
||||||
|
|
|
@ -7,22 +7,21 @@
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
|
||||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
||||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
||||||
// entirely and just use numbers.
|
|
||||||
#define _BASE 0
|
#define _BASE 0
|
||||||
#define _MOVE 1
|
#define _MOVE 1
|
||||||
#define _SYMB 2
|
#define _SYMB 2
|
||||||
#define _MOUSE 3
|
#define _MOUSE 3
|
||||||
#define _FUNC 4
|
#define _FUNC 4
|
||||||
|
#define CMDLEFT LGUI(KC_LEFT)
|
||||||
|
#define CMDRGHT LGUI(KC_RGHT)
|
||||||
|
#define ENDASH LALT(KC_MINS)
|
||||||
|
#define POUND LALT(KC_3)
|
||||||
|
|
||||||
|
|
||||||
enum planck_keycodes {
|
enum planck_keycodes {
|
||||||
MOVE = SAFE_RANGE,
|
MOVE = SAFE_RANGE,
|
||||||
SYMB,
|
SYMB,
|
||||||
FUNC,
|
FUNC
|
||||||
BELOW,
|
|
||||||
ABOVE
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fillers to make layering more clear
|
// Fillers to make layering more clear
|
||||||
|
@ -55,16 +54,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del |
|
* | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | | |
|
* | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | | | | Below| | | | | | |
|
* | | | | | | | | | | | | |
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_MOVE] = {
|
[_MOVE] = {
|
||||||
{KC_ESC, XXXXXXX, LGUI(KC_LEFT), KC_UP, LGUI(KC_RGHT), XXXXXXX, XXXXXXX, LGUI(KC_LEFT), KC_UP, LGUI(KC_RGHT), XXXXXXX, KC_ESC },
|
{KC_ESC, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, KC_ESC },
|
||||||
{KC_DEL, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL },
|
{KC_DEL, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL },
|
||||||
{_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, ABOVE, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______},
|
{_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______},
|
||||||
{_______, _______, _______, _______, _______, BELOW, _______, _______, _______, _______, _______, _______}
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* SYMB
|
/* SYMB
|
||||||
|
@ -79,8 +78,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
[_SYMB] = {
|
[_SYMB] = {
|
||||||
{KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LALT(KC_MINS)},
|
{KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, ENDASH },
|
||||||
{KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, LALT(KC_3)},
|
{KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, POUND },
|
||||||
{_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______},
|
{_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______},
|
||||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
},
|
},
|
||||||
|
@ -153,30 +152,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case BELOW:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
register_code(KC_LGUI);
|
|
||||||
register_code(KC_RGHT);
|
|
||||||
unregister_code(KC_RGHT);
|
|
||||||
unregister_code(KC_LGUI);
|
|
||||||
register_code(KC_ENT);
|
|
||||||
unregister_code(KC_ENT);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case ABOVE:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
register_code(KC_LGUI);
|
|
||||||
register_code(KC_LEFT);
|
|
||||||
unregister_code(KC_LEFT);
|
|
||||||
unregister_code(KC_LGUI);
|
|
||||||
register_code(KC_ENT);
|
|
||||||
unregister_code(KC_ENT);
|
|
||||||
register_code(KC_UP);
|
|
||||||
unregister_code(KC_UP);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
This is a layout for the grid planck, built with a few ideals in mind:
|
This is a layout for the grid planck, built with a few ideals in mind:
|
||||||
|
|
||||||
- Minimal response times should be maintained. Keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided – they inevitably send their keycode later than a normal key – interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording as our only means of getting more than one symbol out of a single physical key.
|
- Consistent and minimal response times should be maintained. Keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided – they inevitably send their keycode later than a normal key – interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording as our only means of getting more than one symbol out of a single physical key.
|
||||||
- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible.
|
- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible.
|
||||||
- There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make.
|
- There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make.
|
||||||
|
|
||||||
We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster and other movement keys; a `SYMB` layer, with numbers and symbols; a `FUNC` layer, with function keys and media keys; and a `MOUSE` layer, with mouse emulation.
|
We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster and other movement keys; a `SYMB` layer, with numbers and symbols; a `FUNC` layer, with function keys and media keys; and a `MOUSE` layer, with mouse emulation. The `MOUSE` layer is activated by holding the Move and Symb keys simultaniously.
|
||||||
|
|
||||||
```
|
```
|
||||||
/* BASE
|
/* BASE
|
||||||
|
@ -27,9 +27,9 @@ We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow c
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del |
|
* | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | | |
|
* | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | | | | Below| | | | | | |
|
* | | | | | | | | | | | | |
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow c
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- |
|
* | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | F21 | F22 | F23 | F24 | | | Lock | | | | |
|
* | | F21 | F22 | F23 | F24 | | | Power| | | | |
|
||||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
* | | | | | Prev | Mute | Play | Next | | | | |
|
* | | | | | Prev | Mute | Play | Next | | | | |
|
||||||
* `-----------------------------------------------------------------------------------'
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
|
|
@ -12,11 +12,11 @@ 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
|
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
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = yes # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
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
|
||||||
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.
|
||||||
API_SYSEX_ENABLE = yes # Enable SYSEX API (+5390)
|
API_SYSEX_ENABLE = no # Enable SYSEX API (+5390)
|
||||||
|
|
||||||
# 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
|
||||||
|
|
|
@ -110,15 +110,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
},
|
},
|
||||||
[_RAISE] = { /* RAISE */
|
[_RAISE] = { /* 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_BSPC},
|
||||||
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
{_______, KC_4, KC_5, KC_6, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||||
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, ALTSLASH,_______},
|
{_______, KC_7, KC_8, KC_9, _______, _______, _______, QWERTY, KEYPAD, KEYPAD, ALTSLASH,_______},
|
||||||
{_______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_PGUP}
|
{_______, KC_0, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_HOME, KC_END, KC_PGUP}
|
||||||
},
|
},
|
||||||
[_LOWER] = { /* LOWER */
|
[_LOWER] = { /* 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_BSPC},
|
||||||
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
{_______, 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, QWERTY, KEYPAD, KEYPAD, ALTSLASH, _______},
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, ALTSLASH, _______},
|
||||||
{_______, KEYPAD, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_VOLD, KC_VOLU, KC_PGUP}
|
{_______, KEYPAD, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_HOME, KC_END, KC_PGUP}
|
||||||
},
|
},
|
||||||
[_KEYPAD] = { /* Key Pad */
|
[_KEYPAD] = { /* Key Pad */
|
||||||
{KC_ESC, USERNAME, MVERSION, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC},
|
{KC_ESC, USERNAME, MVERSION, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC},
|
||||||
|
|
|
@ -14,13 +14,16 @@ 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 _QWERTY 0
|
|
||||||
#define _COLEMAK 1
|
enum planck_layers {
|
||||||
#define _DVORAK 2
|
_QWERTY,
|
||||||
#define _LOWER 3
|
_COLEMAK,
|
||||||
#define _RAISE 4
|
_DVORAK,
|
||||||
#define _PLOVER 5
|
_LOWER,
|
||||||
#define _ADJUST 16
|
_RAISE,
|
||||||
|
_PLOVER,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
|
||||||
enum planck_keycodes {
|
enum planck_keycodes {
|
||||||
QWERTY = SAFE_RANGE,
|
QWERTY = SAFE_RANGE,
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
SUBPROJECT = rev3
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "../../config.h"
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
|
@ -0,0 +1,70 @@
|
||||||
|
#include "keymap.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define QWERTY 0
|
||||||
|
#define LOWER 1
|
||||||
|
#define RAISE 2
|
||||||
|
|
||||||
|
// Alias to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
|
||||||
|
// In MacOS, switch between windows within an application
|
||||||
|
#define GUI_GRV LGUI(KC_GRV)
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Ctl | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Esc | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[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_LCTL, 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, MT(MOD_RSFT, KC_ENT) },
|
||||||
|
{KC_ESC, KC_DEL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | GUIGR| | | | | | | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Caps | | Mute | Vol- | Vol+ | | Bksp | $ | % | ^ | | | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | ! | @ | # | \ |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | Enter | | | PgUp | PgUn | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LOWER] = {
|
||||||
|
{GUI_GRV, _______, _______, _______, _______, _______, _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||||
|
{KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, KC_PIPE, KC_PIPE},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_BSLS, KC_ENT},
|
||||||
|
{_______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | ` | ~ | ( | ) | | | 7 | 8 | 9 | 0 | |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | [ | ] | { | } | | | 4 | 5 | 6 | | \ |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | - | _ | = | + | | | 1 | 2 | 3 | |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | Enter | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[RAISE] = {
|
||||||
|
{KC_GRV, KC_GRV, KC_TILD, KC_LPRN, KC_RPRN, _______, _______, KC_7, KC_8, KC_9, KC_0, _______},
|
||||||
|
{_______, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, _______, KC_BSLS},
|
||||||
|
{_______, KC_MINS, KC_UNDS, KC_EQL, KC_PLUS, _______, _______, KC_1, KC_2, KC_3, _______, KC_ENT},
|
||||||
|
{_______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______}
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,26 @@
|
||||||
|
## Flashing Keyboard
|
||||||
|
|
||||||
|
1. Install `dfu` tools:
|
||||||
|
|
||||||
|
brew tap osx-cross/avr
|
||||||
|
brew install avr-libc
|
||||||
|
brew install dfu-programmer
|
||||||
|
|
||||||
|
2. Move to this directory.
|
||||||
|
3. Hit the reset button on the keyboard.
|
||||||
|
4. run `make dfu`.
|
||||||
|
|
||||||
|
## The Keymap
|
||||||
|
|
||||||
|
This keymap is designed for a rev3 Planck Keyboard.
|
||||||
|
|
||||||
|
The default layer is QWERTY. The raise layer has a ten key on the right
|
||||||
|
and common programming punctuation on the left. The lower layer provides the
|
||||||
|
rest of the symbols, mostly mapped with the ten key numbers.
|
||||||
|
|
||||||
|
The normal right shift key uses the `MT` macro to trigger Enter on tap and right
|
||||||
|
shift when held.
|
||||||
|
|
||||||
|
This keymap sets the `PREVENT_STUCK_MODIFIERS` flag to avoid the occasional WTF
|
||||||
|
moments when using a modifier keys and accidentally releasing them after moving
|
||||||
|
to a new layer.
|
|
@ -1,49 +0,0 @@
|
||||||
#include "keymap.h"
|
|
||||||
|
|
||||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
[0] = KEYMAP(
|
|
||||||
TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC,
|
|
||||||
LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,
|
|
||||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN3,
|
|
||||||
ESC, DEL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT),
|
|
||||||
[1] = KEYMAP(
|
|
||||||
GRV, GRV, FN22, FN19, FN10, TRNS, TRNS, 7, 8, 9, 0, BSPC,
|
|
||||||
TRNS, LBRC, RBRC, FN23, FN24, TRNS, TRNS, 4, 5, 6, TRNS, BSLS,
|
|
||||||
TRNS, MINS, FN20, EQL, FN21, TRNS, TRNS, 1, 2, 3, TRNS, ENT,
|
|
||||||
TRNS, TRNS, TRNS, TRNS, TRNS, SPC, FN1, TRNS, PGDN, PGUP, TRNS),
|
|
||||||
[2] = KEYMAP(
|
|
||||||
FN26, FN10, FN11, FN12, FN13, FN14, FN15, FN17, FN18, FN19, FN10, DEL,
|
|
||||||
TRNS, TRNS, MUTE, VOLD, VOLU, TRNS, BSPC, FN14, FN15, FN16, TRNS, FN25,
|
|
||||||
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN11, FN12, FN13, TRNS, ENT,
|
|
||||||
TRNS, TRNS, TRNS, TRNS, FN2, ENT, TRNS, TRNS, PGDN, PGUP, TRNS),
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
|
||||||
[1] = ACTION_LAYER_MOMENTARY(1), // Switch layer raise
|
|
||||||
[2] = ACTION_LAYER_MOMENTARY(2), // Switch layer lower
|
|
||||||
|
|
||||||
[3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Right shift serves as Enter on tap
|
|
||||||
|
|
||||||
// Numeric shift modifiers
|
|
||||||
[10] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
|
|
||||||
[11] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
|
|
||||||
[12] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
|
|
||||||
[13] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
|
|
||||||
[14] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
|
|
||||||
[15] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
|
|
||||||
[16] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
|
|
||||||
[17] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
|
|
||||||
[18] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
|
|
||||||
[19] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
|
|
||||||
|
|
||||||
// Other shift modifiers
|
|
||||||
[20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _
|
|
||||||
[21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // +
|
|
||||||
[22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~
|
|
||||||
[23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // {
|
|
||||||
[24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // }
|
|
||||||
[25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // |
|
|
||||||
|
|
||||||
// Switch windows in app
|
|
||||||
[26] = ACTION_MODS_KEY(MOD_LGUI, KC_GRV),
|
|
||||||
};
|
|
|
@ -9,12 +9,15 @@
|
||||||
// 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 _QWERTY 0
|
|
||||||
#define _COLEMAK 1
|
enum preonic_layers {
|
||||||
#define _DVORAK 2
|
_QWERTY,
|
||||||
#define _LOWER 3
|
_COLEMAK,
|
||||||
#define _RAISE 4
|
_DVORAK,
|
||||||
#define _ADJUST 16
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
|
||||||
enum preonic_keycodes {
|
enum preonic_keycodes {
|
||||||
QWERTY = SAFE_RANGE,
|
QWERTY = SAFE_RANGE,
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
|
@ -0,0 +1,247 @@
|
||||||
|
#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.
|
||||||
|
#define _DVORAK 0
|
||||||
|
#define _QWERTY 1
|
||||||
|
#define _LOWER 2
|
||||||
|
#define _RAISE 3
|
||||||
|
#define _ADJUST 16
|
||||||
|
|
||||||
|
enum preonic_keycodes {
|
||||||
|
DVORAK = SAFE_RANGE,
|
||||||
|
QWERTY,
|
||||||
|
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] = {
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | / |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = {
|
||||||
|
{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_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
|
||||||
|
{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, SFT_T(KC_ENT)},
|
||||||
|
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = {
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||||
|
{_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
|
||||||
|
{_______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||||
|
{_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = {
|
||||||
|
{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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
|
||||||
|
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_HOME, KC_PGUP},
|
||||||
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_END, KC_PGDN},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | _ | + | { | } | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | - | = | [ | ] | \ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = {
|
||||||
|
{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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, 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|Dvorak|Qwerty| | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |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, DVORAK, 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_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||||
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||||
|
|
||||||
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||||
|
|
||||||
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void persistant_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 DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_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,85 @@
|
||||||
|
# smt's Preonic keymap
|
||||||
|
|
||||||
|
This keymap is primarily based on the default Preonic keymap, which in turn is derived from Planck's default.
|
||||||
|
|
||||||
|
Notable differences from the default are:
|
||||||
|
|
||||||
|
1. **Dvorak by default**
|
||||||
|
|
||||||
|
I happen to type in Dvorak, and prefer that layer to be the default on my keyboard. This is easy enough to switch around with Qwerty, Colemak, or whatever.
|
||||||
|
|
||||||
|
2. **Right Shift**
|
||||||
|
|
||||||
|
I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory.
|
||||||
|
|
||||||
|
Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome!
|
||||||
|
|
||||||
|
## Dvorak (default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Tab | " | , | . | P | Y | F | G | C | R | L | / |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Qwerty (same as default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Lower
|
||||||
|
|
||||||
|
This is where I put the number row, a numpad cluster, function keys, and some light navigation via Home/End/PageUp/PageDn. Like the "Raise" layer, the top row is redundant to help with Planck compatibility.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Raise
|
||||||
|
|
||||||
|
As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets really helps a lot.
|
||||||
|
|
||||||
|
I haven't completely filled this layer, which leaves room for future mappings and macros.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | | | | | | | _ | + | { | } | | |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | | | | | | | - | = | [ | ] | \ |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
|
@ -0,0 +1,3 @@
|
||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
include ../../Makefile
|
||||||
|
endif
|
|
@ -0,0 +1,61 @@
|
||||||
|
ps2avrGB keyboard firmware
|
||||||
|
==========================
|
||||||
|
|
||||||
|
This is a port of the QMK firmware for boards that are based on the
|
||||||
|
ps2avrGB firmware, like the [ps2avrGB
|
||||||
|
keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold
|
||||||
|
by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/).
|
||||||
|
|
||||||
|
Note that this is a complete replacement for the firmware, so you won't be
|
||||||
|
using Bootmapper Client to change any keyboard settings, since not all the
|
||||||
|
USB report options are supported.
|
||||||
|
|
||||||
|
## Supported Boards
|
||||||
|
|
||||||
|
Only the [B.mini X2](http://winkeyless.kr/product/b-mini-x2-pcb/) has been
|
||||||
|
tested so far (since it's the only one I own). But other boards that use
|
||||||
|
the ps2avrGB firmware should work as well.
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
First, install the requirements. These commands are for OSX, but all you
|
||||||
|
need is the AVR toolchain and `bootloadHID` for flashing:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ brew cask install crosspack-avr
|
||||||
|
$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to use the `./program` script, which can reboot the board into
|
||||||
|
the bootloader, you'll need Python 2 with PyUSB installed:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ pip install pyusb
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, with the keyboard plugged in, simply run this command from the
|
||||||
|
`qmk_firmware` directory:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make ps2avrGB-program
|
||||||
|
```
|
||||||
|
|
||||||
|
If you prefer, you can just build it and flash the firmware directly with
|
||||||
|
`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it
|
||||||
|
in the bootloader:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make ps2avrGB
|
||||||
|
$ bootloadHID -r ps2avrGB_default.hex
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
From my experience, it's really hard to brick these boards. But these
|
||||||
|
tricks have been useful when it got stuck in a weird scenario.
|
||||||
|
|
||||||
|
1. Try plugging the board in while pressing `L_Ctrl`. This will force it
|
||||||
|
to boot only the bootloader without loading the firmware. Once this is
|
||||||
|
done, just reflash the board with the original firmware.
|
||||||
|
2. Sometimes USB hubs can act weird, so try connecting the board directly
|
||||||
|
to your computer or plugging/unplugging the USB hub.
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@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
|
||||||
|
|
||||||
|
#define VENDOR_ID 0x20A0
|
||||||
|
#define PRODUCT_ID 0x422D
|
||||||
|
// TODO: share these strings with usbconfig.h
|
||||||
|
// Edit usbconfig.h to change these.
|
||||||
|
#define MANUFACTURER winkeyless.kr
|
||||||
|
#define PRODUCT ps2avrGB
|
||||||
|
|
||||||
|
/* matrix size */
|
||||||
|
#define MATRIX_ROWS 8
|
||||||
|
#define MATRIX_COLS 15
|
||||||
|
|
||||||
|
#define NO_UART 1
|
||||||
|
#define BOOTLOADHID_BOOTLOADER 1
|
||||||
|
|
||||||
|
/* key combination for command */
|
||||||
|
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ps2avrGB.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
KEYMAP( \
|
||||||
|
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, \
|
||||||
|
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,\
|
||||||
|
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\
|
||||||
|
LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
};
|
|
@ -0,0 +1,104 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
#include "matrix.h"
|
||||||
|
|
||||||
|
#ifndef DEBOUNCE
|
||||||
|
# define DEBOUNCE 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static uint8_t debouncing = DEBOUNCE;
|
||||||
|
|
||||||
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
// all outputs for rows high
|
||||||
|
DDRB = 0xFF;
|
||||||
|
PORTB = 0xFF;
|
||||||
|
// all inputs for columns
|
||||||
|
DDRA = 0x00;
|
||||||
|
DDRC &= ~(0x111111<<2);
|
||||||
|
DDRD &= ~(1<<PIND7);
|
||||||
|
// all columns are pulled-up
|
||||||
|
PORTA = 0xFF;
|
||||||
|
PORTC |= (0b111111<<2);
|
||||||
|
PORTD |= (1<<PIND7);
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
matrix[row] = 0x00;
|
||||||
|
matrix_debouncing[row] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_set_row_status(uint8_t row) {
|
||||||
|
DDRB = (1 << row);
|
||||||
|
PORTB = ~(1 << row);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t bit_reverse(uint8_t x) {
|
||||||
|
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||||
|
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
|
||||||
|
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void) {
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
matrix_set_row_status(row);
|
||||||
|
_delay_us(5);
|
||||||
|
|
||||||
|
matrix_row_t cols = (
|
||||||
|
// cols 0..7, PORTA 0 -> 7
|
||||||
|
(~PINA) & 0xFF
|
||||||
|
) | (
|
||||||
|
// cols 8..13, PORTC 7 -> 0
|
||||||
|
bit_reverse((~PINC) & 0xFF) << 8
|
||||||
|
) | (
|
||||||
|
// col 14, PORTD 7
|
||||||
|
((~PIND) & (1 << PIND7)) << 7
|
||||||
|
);
|
||||||
|
|
||||||
|
if (matrix_debouncing[row] != cols) {
|
||||||
|
matrix_debouncing[row] = cols;
|
||||||
|
debouncing = DEBOUNCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debouncing) {
|
||||||
|
if (--debouncing) {
|
||||||
|
_delay_ms(1);
|
||||||
|
} else {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline matrix_row_t matrix_get_row(uint8_t row) {
|
||||||
|
return matrix[row];
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void) {
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import usb
|
||||||
|
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print('Usage: %s <firmware.hex>' % sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print('Searching for ps2avrGB... ', end='')
|
||||||
|
|
||||||
|
dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D)
|
||||||
|
if dev is None:
|
||||||
|
raise ValueError('Device not found')
|
||||||
|
|
||||||
|
print('Found', end='\n\n')
|
||||||
|
|
||||||
|
print('Device Information:')
|
||||||
|
print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor))
|
||||||
|
print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct))
|
||||||
|
print('Manufacturer: %s' % (dev.iManufacturer))
|
||||||
|
print('Serial: %s' % (dev.iSerialNumber))
|
||||||
|
print('Product: %s' % (dev.iProduct), end='\n\n')
|
||||||
|
|
||||||
|
print('Transferring control to bootloader... ', end='')
|
||||||
|
|
||||||
|
dev.set_configuration()
|
||||||
|
|
||||||
|
request_type = usb.util.build_request_type(
|
||||||
|
usb.util.CTRL_OUT,
|
||||||
|
usb.util.CTRL_TYPE_CLASS,
|
||||||
|
usb.util.CTRL_RECIPIENT_DEVICE)
|
||||||
|
|
||||||
|
USBRQ_HID_SET_REPORT = 0x09
|
||||||
|
HID_REPORT_OPTION = 0x0301
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
dev.ctrl_transfer(
|
||||||
|
request_type,
|
||||||
|
USBRQ_HID_SET_REPORT,
|
||||||
|
HID_REPORT_OPTION,
|
||||||
|
0,
|
||||||
|
[0, 0, 0xFF] + [0] * 5
|
||||||
|
)
|
||||||
|
except usb.core.USBError:
|
||||||
|
# for some reason I keep getting USBError, but it works!
|
||||||
|
pass
|
||||||
|
|
||||||
|
# wait a bit until bootloader starts up
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
|
print('OK')
|
||||||
|
print('Programming...')
|
||||||
|
if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0:
|
||||||
|
print('\nDone!')
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@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 KEYMAP_COMMON_H
|
||||||
|
#define KEYMAP_COMMON_H
|
||||||
|
|
||||||
|
#include "keycode.h"
|
||||||
|
#include "action.h"
|
||||||
|
|
||||||
|
#define 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_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \
|
||||||
|
{ KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA2, KC_##KB2, KC_NO, KC_##KD2, KC_##KE2 }, \
|
||||||
|
{ KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \
|
||||||
|
{ KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \
|
||||||
|
{ KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \
|
||||||
|
{ KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \
|
||||||
|
{ KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
MCU = atmega32a
|
||||||
|
PROTOCOL = VUSB
|
||||||
|
|
||||||
|
# unsupported features for now
|
||||||
|
NO_UART = yes
|
||||||
|
NO_SUSPEND_POWER_DOWN = yes
|
||||||
|
BACKLIGHT_ENABLE = no
|
||||||
|
|
||||||
|
# processor frequency
|
||||||
|
F_CPU = 12000000
|
||||||
|
|
||||||
|
# build options
|
||||||
|
BOOTMAGIC_ENABLE = yes
|
||||||
|
MOUSEKEY_ENABLE = yes
|
||||||
|
EXTRAKEY_ENABLE = yes
|
||||||
|
CONSOLE_ENABLE = yes
|
||||||
|
COMMAND_ENABLE = yes
|
||||||
|
|
||||||
|
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||||
|
|
||||||
|
# custom matrix setup
|
||||||
|
CUSTOM_MATRIX = yes
|
||||||
|
SRC = matrix.c
|
||||||
|
|
||||||
|
# programming options
|
||||||
|
PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex
|
|
@ -0,0 +1,396 @@
|
||||||
|
/* Name: usbconfig.h
|
||||||
|
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
|
||||||
|
* Author: Christian Starkjohann
|
||||||
|
* Creation Date: 2005-04-01
|
||||||
|
* Tabsize: 4
|
||||||
|
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
|
||||||
|
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
|
||||||
|
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __usbconfig_h_included__
|
||||||
|
#define __usbconfig_h_included__
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
General Description:
|
||||||
|
This file is an example configuration (with inline documentation) for the USB
|
||||||
|
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
|
||||||
|
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
|
||||||
|
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
|
||||||
|
other hardware interrupt, as long as it is the highest level interrupt, see
|
||||||
|
section at the end of this file).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ---------------------------- Hardware Config ---------------------------- */
|
||||||
|
|
||||||
|
#define USB_CFG_IOPORTNAME D
|
||||||
|
/* This is the port where the USB bus is connected. When you configure it to
|
||||||
|
* "B", the registers PORTB, PINB and DDRB will be used.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DMINUS_BIT 3
|
||||||
|
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
|
||||||
|
* This may be any bit in the port.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DPLUS_BIT 2
|
||||||
|
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
|
||||||
|
* This may be any bit in the port. Please note that D+ must also be connected
|
||||||
|
* to interrupt pin INT0! [You can also use other interrupts, see section
|
||||||
|
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
|
||||||
|
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
|
||||||
|
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
|
||||||
|
* markers every millisecond.]
|
||||||
|
*/
|
||||||
|
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
|
||||||
|
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
|
||||||
|
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
|
||||||
|
* require no crystal, they tolerate +/- 1% deviation from the nominal
|
||||||
|
* frequency. All other rates require a precision of 2000 ppm and thus a
|
||||||
|
* crystal!
|
||||||
|
* Since F_CPU should be defined to your actual clock rate anyway, you should
|
||||||
|
* not need to modify this setting.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_CHECK_CRC 0
|
||||||
|
/* Define this to 1 if you want that the driver checks integrity of incoming
|
||||||
|
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
|
||||||
|
* currently only available for 18 MHz crystal clock. You must choose
|
||||||
|
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ----------------------- Optional Hardware Config ------------------------ */
|
||||||
|
|
||||||
|
/* #define USB_CFG_PULLUP_IOPORTNAME D */
|
||||||
|
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
|
||||||
|
* V+, you can connect and disconnect the device from firmware by calling
|
||||||
|
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
|
||||||
|
* This constant defines the port on which the pullup resistor is connected.
|
||||||
|
*/
|
||||||
|
/* #define USB_CFG_PULLUP_BIT 4 */
|
||||||
|
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
|
||||||
|
* above) where the 1.5k pullup resistor is connected. See description
|
||||||
|
* above for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* --------------------------- Functional Range ---------------------------- */
|
||||||
|
|
||||||
|
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
|
||||||
|
/* Define this to 1 if you want to compile a version with two endpoints: The
|
||||||
|
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
|
||||||
|
* number).
|
||||||
|
*/
|
||||||
|
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
|
||||||
|
/* Define this to 1 if you want to compile a version with three endpoints: The
|
||||||
|
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
|
||||||
|
* configured below) and a catch-all default interrupt-in endpoint as above.
|
||||||
|
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_EP3_NUMBER 3
|
||||||
|
/* If the so-called endpoint 3 is used, it can now be configured to any other
|
||||||
|
* endpoint number (except 0) with this macro. Default if undefined is 3.
|
||||||
|
*/
|
||||||
|
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
|
||||||
|
/* The above macro defines the startup condition for data toggling on the
|
||||||
|
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
|
||||||
|
* Since the token is toggled BEFORE sending any data, the first packet is
|
||||||
|
* sent with the oposite value of this configuration!
|
||||||
|
*/
|
||||||
|
#define USB_CFG_IMPLEMENT_HALT 0
|
||||||
|
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
|
||||||
|
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
|
||||||
|
* it is required by the standard. We have made it a config option because it
|
||||||
|
* bloats the code considerably.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_SUPPRESS_INTR_CODE 0
|
||||||
|
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
|
||||||
|
* want to send any data over them. If this macro is defined to 1, functions
|
||||||
|
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
|
||||||
|
* you need the interrupt-in endpoints in order to comply to an interface
|
||||||
|
* (e.g. HID), but never want to send any data. This option saves a couple
|
||||||
|
* of bytes in flash memory and the transmit buffers in RAM.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_INTR_POLL_INTERVAL 1
|
||||||
|
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
|
||||||
|
* interval. The value is in milliseconds and must not be less than 10 ms for
|
||||||
|
* low speed devices.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_IS_SELF_POWERED 0
|
||||||
|
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
|
||||||
|
* device is powered from the USB bus.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_MAX_BUS_POWER 500
|
||||||
|
/* Set this variable to the maximum USB bus power consumption of your device.
|
||||||
|
* The value is in milliamperes. [It will be divided by two since USB
|
||||||
|
* communicates power requirements in units of 2 mA.]
|
||||||
|
*/
|
||||||
|
#define USB_CFG_IMPLEMENT_FN_WRITE 1
|
||||||
|
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
|
||||||
|
* transfers. Set it to 0 if you don't need it and want to save a couple of
|
||||||
|
* bytes.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_IMPLEMENT_FN_READ 0
|
||||||
|
/* Set this to 1 if you need to send control replies which are generated
|
||||||
|
* "on the fly" when usbFunctionRead() is called. If you only want to send
|
||||||
|
* data from a static buffer, set it to 0 and return the data from
|
||||||
|
* usbFunctionSetup(). This saves a couple of bytes.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
|
||||||
|
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
|
||||||
|
* You must implement the function usbFunctionWriteOut() which receives all
|
||||||
|
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
|
||||||
|
* can be found in 'usbRxToken'.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_HAVE_FLOWCONTROL 0
|
||||||
|
/* Define this to 1 if you want flowcontrol over USB data. See the definition
|
||||||
|
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
|
||||||
|
* usbdrv.h.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DRIVER_FLASH_PAGE 0
|
||||||
|
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
|
||||||
|
* where the driver's constants (descriptors) are located. Or in other words:
|
||||||
|
* Define this to 1 for boot loaders on the ATMega128.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_LONG_TRANSFERS 0
|
||||||
|
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
|
||||||
|
* in a single control-in or control-out transfer. Note that the capability
|
||||||
|
* for long transfers increases the driver size.
|
||||||
|
*/
|
||||||
|
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
|
||||||
|
/* This macro is a hook if you want to do unconventional things. If it is
|
||||||
|
* defined, it's inserted at the beginning of received message processing.
|
||||||
|
* If you eat the received message and don't want default processing to
|
||||||
|
* proceed, do a return after doing your things. One possible application
|
||||||
|
* (besides debugging) is to flash a status LED on each packet.
|
||||||
|
*/
|
||||||
|
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
|
||||||
|
/* This macro is a hook if you need to know when an USB RESET occurs. It has
|
||||||
|
* one parameter which distinguishes between the start of RESET state and its
|
||||||
|
* end.
|
||||||
|
*/
|
||||||
|
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
|
||||||
|
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
|
||||||
|
* received.
|
||||||
|
*/
|
||||||
|
#define USB_COUNT_SOF 1
|
||||||
|
/* define this macro to 1 if you need the global variable "usbSofCount" which
|
||||||
|
* counts SOF packets. This feature requires that the hardware interrupt is
|
||||||
|
* connected to D- instead of D+.
|
||||||
|
*/
|
||||||
|
/* #ifdef __ASSEMBLER__
|
||||||
|
* macro myAssemblerMacro
|
||||||
|
* in YL, TCNT0
|
||||||
|
* sts timer0Snapshot, YL
|
||||||
|
* endm
|
||||||
|
* #endif
|
||||||
|
* #define USB_SOF_HOOK myAssemblerMacro
|
||||||
|
* This macro (if defined) is executed in the assembler module when a
|
||||||
|
* Start Of Frame condition is detected. It is recommended to define it to
|
||||||
|
* the name of an assembler macro which is defined here as well so that more
|
||||||
|
* than one assembler instruction can be used. The macro may use the register
|
||||||
|
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
|
||||||
|
* immediately after an SOF pulse may be lost and must be retried by the host.
|
||||||
|
* What can you do with this hook? Since the SOF signal occurs exactly every
|
||||||
|
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
|
||||||
|
* designs running on the internal RC oscillator.
|
||||||
|
* Please note that Start Of Frame detection works only if D- is wired to the
|
||||||
|
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
|
||||||
|
*/
|
||||||
|
#define USB_CFG_CHECK_DATA_TOGGLING 0
|
||||||
|
/* define this macro to 1 if you want to filter out duplicate data packets
|
||||||
|
* sent by the host. Duplicates occur only as a consequence of communication
|
||||||
|
* errors, when the host does not receive an ACK. Please note that you need to
|
||||||
|
* implement the filtering yourself in usbFunctionWriteOut() and
|
||||||
|
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
|
||||||
|
* for each control- and out-endpoint to check for duplicate packets.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
|
||||||
|
/* define this macro to 1 if you want the function usbMeasureFrameLength()
|
||||||
|
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
|
||||||
|
*/
|
||||||
|
#define USB_USE_FAST_CRC 0
|
||||||
|
/* The assembler module has two implementations for the CRC algorithm. One is
|
||||||
|
* faster, the other is smaller. This CRC routine is only used for transmitted
|
||||||
|
* messages where timing is not critical. The faster routine needs 31 cycles
|
||||||
|
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
|
||||||
|
* may be worth the 32 bytes bigger code size if you transmit lots of data and
|
||||||
|
* run the AVR close to its limit.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* -------------------------- Device Description --------------------------- */
|
||||||
|
|
||||||
|
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
|
||||||
|
/* USB vendor ID for the device, low byte first. If you have registered your
|
||||||
|
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
|
||||||
|
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
|
||||||
|
* *** IMPORTANT NOTE ***
|
||||||
|
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||||
|
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||||
|
* the implications!
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
|
||||||
|
/* This is the ID of the product, low byte first. It is interpreted in the
|
||||||
|
* scope of the vendor ID. If you have registered your own VID with usb.org
|
||||||
|
* or if you have licensed a PID from somebody else, define it here. Otherwise
|
||||||
|
* you may use one of obdev's free shared VID/PID pairs. See the file
|
||||||
|
* USB-IDs-for-free.txt for details!
|
||||||
|
* *** IMPORTANT NOTE ***
|
||||||
|
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||||
|
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||||
|
* the implications!
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
|
||||||
|
/* Version number of the device: Minor number first, then major number.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
|
||||||
|
#define USB_CFG_VENDOR_NAME_LEN 13
|
||||||
|
/* These two values define the vendor name returned by the USB device. The name
|
||||||
|
* must be given as a list of characters under single quotes. The characters
|
||||||
|
* are interpreted as Unicode (UTF-16) entities.
|
||||||
|
* If you don't want a vendor name string, undefine these macros.
|
||||||
|
* ALWAYS define a vendor name containing your Internet domain name if you use
|
||||||
|
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
|
||||||
|
* details.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
|
||||||
|
#define USB_CFG_DEVICE_NAME_LEN 8
|
||||||
|
/* Same as above for the device name. If you don't want a device name, undefine
|
||||||
|
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
|
||||||
|
* you use a shared VID/PID.
|
||||||
|
*/
|
||||||
|
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
|
||||||
|
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
|
||||||
|
/* Same as above for the serial number. If you don't want a serial number,
|
||||||
|
* undefine the macros.
|
||||||
|
* It may be useful to provide the serial number through other means than at
|
||||||
|
* compile time. See the section about descriptor properties below for how
|
||||||
|
* to fine tune control over USB descriptors such as the string descriptor
|
||||||
|
* for the serial number.
|
||||||
|
*/
|
||||||
|
#define USB_CFG_DEVICE_CLASS 0
|
||||||
|
#define USB_CFG_DEVICE_SUBCLASS 0
|
||||||
|
/* See USB specification if you want to conform to an existing device class.
|
||||||
|
* Class 0xff is "vendor specific".
|
||||||
|
*/
|
||||||
|
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
|
||||||
|
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
|
||||||
|
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
|
||||||
|
/* See USB specification if you want to conform to an existing device class or
|
||||||
|
* protocol. The following classes must be set at interface level:
|
||||||
|
* HID class is 3, no subclass and protocol required (but may be useful!)
|
||||||
|
* CDC class is 2, use subclass 2 and protocol 1 for ACM
|
||||||
|
*/
|
||||||
|
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
|
||||||
|
/* Define this to the length of the HID report descriptor, if you implement
|
||||||
|
* an HID device. Otherwise don't define it or define it to 0.
|
||||||
|
* If you use this define, you must add a PROGMEM character array named
|
||||||
|
* "usbHidReportDescriptor" to your code which contains the report descriptor.
|
||||||
|
* Don't forget to keep the array and this define in sync!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* #define USB_PUBLIC static */
|
||||||
|
/* Use the define above if you #include usbdrv.c instead of linking against it.
|
||||||
|
* This technique saves a couple of bytes in flash memory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ------------------- Fine Control over USB Descriptors ------------------- */
|
||||||
|
/* If you don't want to use the driver's default USB descriptors, you can
|
||||||
|
* provide our own. These can be provided as (1) fixed length static data in
|
||||||
|
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
|
||||||
|
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
|
||||||
|
* information about this function.
|
||||||
|
* Descriptor handling is configured through the descriptor's properties. If
|
||||||
|
* no properties are defined or if they are 0, the default descriptor is used.
|
||||||
|
* Possible properties are:
|
||||||
|
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
|
||||||
|
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
|
||||||
|
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
|
||||||
|
* you want RAM pointers.
|
||||||
|
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
|
||||||
|
* in static memory is in RAM, not in flash memory.
|
||||||
|
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
|
||||||
|
* the driver must know the descriptor's length. The descriptor itself is
|
||||||
|
* found at the address of a well known identifier (see below).
|
||||||
|
* List of static descriptor names (must be declared PROGMEM if in flash):
|
||||||
|
* char usbDescriptorDevice[];
|
||||||
|
* char usbDescriptorConfiguration[];
|
||||||
|
* char usbDescriptorHidReport[];
|
||||||
|
* char usbDescriptorString0[];
|
||||||
|
* int usbDescriptorStringVendor[];
|
||||||
|
* int usbDescriptorStringDevice[];
|
||||||
|
* int usbDescriptorStringSerialNumber[];
|
||||||
|
* Other descriptors can't be provided statically, they must be provided
|
||||||
|
* dynamically at runtime.
|
||||||
|
*
|
||||||
|
* Descriptor properties are or-ed or added together, e.g.:
|
||||||
|
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
|
||||||
|
*
|
||||||
|
* The following descriptors are defined:
|
||||||
|
* USB_CFG_DESCR_PROPS_DEVICE
|
||||||
|
* USB_CFG_DESCR_PROPS_CONFIGURATION
|
||||||
|
* USB_CFG_DESCR_PROPS_STRINGS
|
||||||
|
* USB_CFG_DESCR_PROPS_STRING_0
|
||||||
|
* USB_CFG_DESCR_PROPS_STRING_VENDOR
|
||||||
|
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
|
||||||
|
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
|
||||||
|
* USB_CFG_DESCR_PROPS_HID
|
||||||
|
* USB_CFG_DESCR_PROPS_HID_REPORT
|
||||||
|
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
|
||||||
|
*
|
||||||
|
* Note about string descriptors: String descriptors are not just strings, they
|
||||||
|
* are Unicode strings prefixed with a 2 byte header. Example:
|
||||||
|
* int serialNumberDescriptor[] = {
|
||||||
|
* USB_STRING_DESCRIPTOR_HEADER(6),
|
||||||
|
* 'S', 'e', 'r', 'i', 'a', 'l'
|
||||||
|
* };
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define USB_CFG_DESCR_PROPS_DEVICE 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
|
||||||
|
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_STRINGS 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_STRING_0 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
|
||||||
|
//#define USB_CFG_DESCR_PROPS_HID 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
|
||||||
|
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
|
||||||
|
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
|
||||||
|
|
||||||
|
#define usbMsgPtr_t unsigned short
|
||||||
|
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
|
||||||
|
* a scalar type here because gcc generates slightly shorter code for scalar
|
||||||
|
* arithmetics than for pointer arithmetics. Remove this define for backward
|
||||||
|
* type compatibility or define it to an 8 bit type if you use data in RAM only
|
||||||
|
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ----------------------- Optional MCU Description ------------------------ */
|
||||||
|
|
||||||
|
/* The following configurations have working defaults in usbdrv.h. You
|
||||||
|
* usually don't need to set them explicitly. Only if you want to run
|
||||||
|
* the driver on a device which is not yet supported or with a compiler
|
||||||
|
* which is not fully supported (such as IAR C) or if you use a differnt
|
||||||
|
* interrupt than INT0, you may have to define some of these.
|
||||||
|
*/
|
||||||
|
/* #define USB_INTR_CFG MCUCR */
|
||||||
|
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
|
||||||
|
/* #define USB_INTR_CFG_CLR 0 */
|
||||||
|
/* #define USB_INTR_ENABLE GIMSK */
|
||||||
|
/* #define USB_INTR_ENABLE_BIT INT0 */
|
||||||
|
/* #define USB_INTR_PENDING GIFR */
|
||||||
|
/* #define USB_INTR_PENDING_BIT INTF0 */
|
||||||
|
/* #define USB_INTR_VECTOR INT0_vect */
|
||||||
|
|
||||||
|
/* Set INT1 for D- falling edge to count SOF */
|
||||||
|
/* #define USB_INTR_CFG EICRA */
|
||||||
|
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
|
||||||
|
/* #define USB_INTR_CFG_CLR 0 */
|
||||||
|
/* #define USB_INTR_ENABLE EIMSK */
|
||||||
|
#define USB_INTR_ENABLE_BIT INT1
|
||||||
|
/* #define USB_INTR_PENDING EIFR */
|
||||||
|
#define USB_INTR_PENDING_BIT INTF1
|
||||||
|
#define USB_INTR_VECTOR INT1_vect
|
||||||
|
|
||||||
|
#endif /* __usbconfig_h_included__ */
|
|
@ -114,6 +114,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
|
||||||
music_sequence_interval+=10;
|
music_sequence_interval+=10;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#define MUSIC_MODE_GUITAR
|
||||||
|
|
||||||
#ifdef MUSIC_MODE_CHROMATIC
|
#ifdef MUSIC_MODE_CHROMATIC
|
||||||
float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(MATRIX_ROWS - record->event.key.row));
|
float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(MATRIX_ROWS - record->event.key.row));
|
||||||
|
|
|
@ -53,10 +53,13 @@ SOFTWARE.
|
||||||
#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,
|
||||||
.leds = 0xFFFFFFFF,
|
.leds = 0xFFFFFFFF,
|
||||||
.suspended = false,
|
.suspended = false,
|
||||||
};
|
};
|
||||||
|
@ -64,6 +67,7 @@ static visualizer_keyboard_status_t current_status = {
|
||||||
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) {
|
||||||
return status1->layer == status2->layer &&
|
return status1->layer == status2->layer &&
|
||||||
status1->default_layer == status2->default_layer &&
|
status1->default_layer == status2->default_layer &&
|
||||||
|
status1->mods == status2->mods &&
|
||||||
status1->leds == status2->leds &&
|
status1->leds == status2->leds &&
|
||||||
status1->suspended == status2->suspended;
|
status1->suspended == status2->suspended;
|
||||||
}
|
}
|
||||||
|
@ -307,6 +311,45 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s
|
||||||
gdispFlush();
|
gdispFlush();
|
||||||
return false;
|
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
|
#endif // LCD_ENABLE
|
||||||
|
|
||||||
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
|
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||||
|
@ -350,6 +393,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
|
||||||
visualizer_keyboard_status_t initial_status = {
|
visualizer_keyboard_status_t initial_status = {
|
||||||
.default_layer = 0xFFFFFFFF,
|
.default_layer = 0xFFFFFFFF,
|
||||||
.layer = 0xFFFFFFFF,
|
.layer = 0xFFFFFFFF,
|
||||||
|
.mods = 0xFF,
|
||||||
.leds = 0xFFFFFFFF,
|
.leds = 0xFFFFFFFF,
|
||||||
.suspended = false,
|
.suspended = false,
|
||||||
};
|
};
|
||||||
|
@ -499,7 +543,18 @@ void update_status(bool changed) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) {
|
uint8_t visualizer_get_mods() {
|
||||||
|
uint8_t mods = get_mods();
|
||||||
|
|
||||||
|
#ifndef NO_ACTION_ONESHOT
|
||||||
|
if (!has_oneshot_mods_timed_out()) {
|
||||||
|
mods |= get_oneshot_mods();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return mods;
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
// not really matter as it will be fixed during the next loop step.
|
// not really matter as it will be fixed during the next loop step.
|
||||||
|
@ -523,6 +578,7 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) {
|
||||||
visualizer_keyboard_status_t new_status = {
|
visualizer_keyboard_status_t new_status = {
|
||||||
.layer = state,
|
.layer = state,
|
||||||
.default_layer = default_state,
|
.default_layer = default_state,
|
||||||
|
.mods = mods,
|
||||||
.leds = leds,
|
.leds = leds,
|
||||||
.suspended = current_status.suspended,
|
.suspended = current_status.suspended,
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,10 +34,14 @@ 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
|
||||||
|
uint8_t visualizer_get_mods(void);
|
||||||
|
|
||||||
// This need to be called once at the start
|
// This need to be called once at the start
|
||||||
void visualizer_init(void);
|
void visualizer_init(void);
|
||||||
// This should be called at every matrix scan
|
// This should be called at every matrix scan
|
||||||
void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds);
|
void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uint32_t leds);
|
||||||
|
|
||||||
// This should be called when the keyboard goes to suspend state
|
// This should be called when the keyboard goes to suspend state
|
||||||
void visualizer_suspend(void);
|
void visualizer_suspend(void);
|
||||||
// This should be called when the keyboard wakes up from suspend state
|
// This should be called when the keyboard wakes up from suspend state
|
||||||
|
@ -61,6 +65,7 @@ struct keyframe_animation_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t layer;
|
uint32_t layer;
|
||||||
uint32_t default_layer;
|
uint32_t default_layer;
|
||||||
|
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;
|
||||||
} visualizer_keyboard_status_t;
|
} visualizer_keyboard_status_t;
|
||||||
|
@ -129,6 +134,8 @@ bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_st
|
||||||
bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
|
bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state);
|
||||||
// Displays a bitmap (0/1) of all the currently active layers
|
// Displays a bitmap (0/1) of all the currently active layers
|
||||||
bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
|
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_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);
|
bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Quantum Mechanical Keyboard Firmware
|
# Quantum Mechanical Keyboard Firmware
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/jackhumbert/qmk_firmware.svg?branch=master)](https://travis-ci.org/jackhumbert/qmk_firmware)
|
[![Build Status](https://travis-ci.org/jackhumbert/qmk_firmware.svg?branch=master)](https://travis-ci.org/jackhumbert/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)
|
||||||
|
|
||||||
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 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/).
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ The project also includes community support for [lots of other keyboards](/keybo
|
||||||
|
|
||||||
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). 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 :)
|
||||||
|
|
||||||
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/jackhumbert/qmk_firmware/issues/new).
|
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).
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/j
|
||||||
|
|
||||||
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:
|
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/jackhumbert/qmk_firmware/wiki) - the entirety of the readme has been moved here
|
* [**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 EZ, it's [here](keyboards/ergodox/ez/); for the Planck, it's [here](keyboards/planck/) and so on.
|
* The readme for your own keyboard: This is found under `keyboards/<your keyboards's name>/`. So for the ErgoDox EZ, it's [here](keyboards/ergodox/ez/); 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:
|
* 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.
|
* [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes.
|
||||||
|
|
|
@ -80,6 +80,14 @@ ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
|
||||||
TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
|
TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(NO_UART)), yes)
|
||||||
|
TMK_COMMON_DEFS += -DNO_UART
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
|
||||||
|
TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
||||||
TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c
|
TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c
|
||||||
TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
|
TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
#include <avr/eeprom.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
@ -89,6 +90,12 @@ void bootloader_jump(void) {
|
||||||
_delay_ms(5);
|
_delay_ms(5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOOTLOADHID_BOOTLOADER
|
||||||
|
// force bootloadHID to stay in bootloader mode, so that it waits
|
||||||
|
// for a new firmware to be flashed
|
||||||
|
eeprom_write_byte((uint8_t *)1, 0x00);
|
||||||
|
#endif
|
||||||
|
|
||||||
// watchdog reset
|
// watchdog reset
|
||||||
reset_key = BOOTLOADER_RESET_KEY;
|
reset_key = BOOTLOADER_RESET_KEY;
|
||||||
wdt_enable(WDTO_250MS);
|
wdt_enable(WDTO_250MS);
|
||||||
|
@ -114,6 +121,11 @@ void bootloader_jump(void) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __AVR_ATmega32A__
|
||||||
|
// MCUSR is actually called MCUCSR in ATmega32A
|
||||||
|
#define MCUSR MCUCSR
|
||||||
|
#endif
|
||||||
|
|
||||||
/* this runs before main() */
|
/* this runs before main() */
|
||||||
void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, section (".init3")));
|
void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, section (".init3")));
|
||||||
void bootloader_jump_after_watchdog_reset(void)
|
void bootloader_jump_after_watchdog_reset(void)
|
||||||
|
|
|
@ -29,25 +29,35 @@ volatile uint32_t timer_count;
|
||||||
|
|
||||||
void timer_init(void)
|
void timer_init(void)
|
||||||
{
|
{
|
||||||
// Timer0 CTC mode
|
|
||||||
TCCR0A = 0x02;
|
|
||||||
|
|
||||||
#if TIMER_PRESCALER == 1
|
#if TIMER_PRESCALER == 1
|
||||||
TCCR0B = 0x01;
|
uint8_t prescaler = 0x01;
|
||||||
#elif TIMER_PRESCALER == 8
|
#elif TIMER_PRESCALER == 8
|
||||||
TCCR0B = 0x02;
|
uint8_t prescaler = 0x02;
|
||||||
#elif TIMER_PRESCALER == 64
|
#elif TIMER_PRESCALER == 64
|
||||||
TCCR0B = 0x03;
|
uint8_t prescaler = 0x03;
|
||||||
#elif TIMER_PRESCALER == 256
|
#elif TIMER_PRESCALER == 256
|
||||||
TCCR0B = 0x04;
|
uint8_t prescaler = 0x04;
|
||||||
#elif TIMER_PRESCALER == 1024
|
#elif TIMER_PRESCALER == 1024
|
||||||
TCCR0B = 0x05;
|
uint8_t prescaler = 0x05;
|
||||||
#else
|
#else
|
||||||
# error "Timer prescaler value is NOT vaild."
|
# error "Timer prescaler value is NOT vaild."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __AVR_ATmega32A__
|
||||||
|
// Timer0 CTC mode
|
||||||
|
TCCR0A = 0x02;
|
||||||
|
|
||||||
|
TCCR0B = prescaler;
|
||||||
|
|
||||||
OCR0A = TIMER_RAW_TOP;
|
OCR0A = TIMER_RAW_TOP;
|
||||||
TIMSK0 = (1<<OCIE0A);
|
TIMSK0 = (1<<OCIE0A);
|
||||||
|
#else
|
||||||
|
// Timer0 CTC mode
|
||||||
|
TCCR0 = (1 << WGM01) | prescaler;
|
||||||
|
|
||||||
|
OCR0 = TIMER_RAW_TOP;
|
||||||
|
TIMSK = (1 << OCIE0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
@ -107,7 +117,12 @@ uint32_t timer_elapsed32(uint32_t last)
|
||||||
}
|
}
|
||||||
|
|
||||||
// excecuted once per 1ms.(excess for just timer count?)
|
// excecuted once per 1ms.(excess for just timer count?)
|
||||||
ISR(TIMER0_COMPA_vect)
|
#ifndef __AVR_ATmega32A__
|
||||||
|
#define TIMER_INTERRUPT_VECTOR TIMER0_COMPA_vect
|
||||||
|
#else
|
||||||
|
#define TIMER_INTERRUPT_VECTOR TIMER0_COMP_vect
|
||||||
|
#endif
|
||||||
|
ISR(TIMER_INTERRUPT_VECTOR, ISR_NOBLOCK)
|
||||||
{
|
{
|
||||||
timer_count++;
|
timer_count++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,8 +235,11 @@ static void print_status(void)
|
||||||
print("\n\t- Status -\n");
|
print("\n\t- Status -\n");
|
||||||
|
|
||||||
print_val_hex8(host_keyboard_leds());
|
print_val_hex8(host_keyboard_leds());
|
||||||
|
#ifndef PROTOCOL_VUSB
|
||||||
|
// these aren't set on the V-USB protocol, so we just ignore them for now
|
||||||
print_val_hex8(keyboard_protocol);
|
print_val_hex8(keyboard_protocol);
|
||||||
print_val_hex8(keyboard_idle);
|
print_val_hex8(keyboard_idle);
|
||||||
|
#endif
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
print_val_hex8(keymap_config.nkro);
|
print_val_hex8(keymap_config.nkro);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -188,7 +188,7 @@ MATRIX_LOOP_END:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VISUALIZER_ENABLE
|
#ifdef VISUALIZER_ENABLE
|
||||||
visualizer_update(default_layer_state, layer_state, host_keyboard_leds());
|
visualizer_update(default_layer_state, layer_state, visualizer_get_mods(), host_keyboard_leds());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// update LED
|
// update LED
|
||||||
|
|
|
@ -18,4 +18,5 @@ endif
|
||||||
|
|
||||||
|
|
||||||
# Search Path
|
# Search Path
|
||||||
VPATH += $(TMK_DIR)/protocol/vusb:$(TMK_DIR)/protocol/vusb/usbdrv
|
VPATH += $(TMK_PATH)/$(VUSB_DIR)
|
||||||
|
VPATH += $(TMK_PATH)/$(VUSB_DIR)/usbdrv
|
||||||
|
|
|
@ -48,8 +48,12 @@ int main(void)
|
||||||
uint16_t last_timer = timer_read();
|
uint16_t last_timer = timer_read();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CLKPR
|
||||||
|
// avoid unintentional changes of clock frequency in devices that have a
|
||||||
|
// clock prescaler
|
||||||
CLKPR = 0x80, CLKPR = 0;
|
CLKPR = 0x80, CLKPR = 0;
|
||||||
#ifndef PS2_USE_USART
|
#endif
|
||||||
|
#ifndef NO_UART
|
||||||
uart_init(UART_BAUD_RATE);
|
uart_init(UART_BAUD_RATE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ 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 <avr/eeprom.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "usbdrv.h"
|
#include "usbdrv.h"
|
||||||
#include "usbconfig.h"
|
#include "usbconfig.h"
|
||||||
|
@ -24,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "host_driver.h"
|
#include "host_driver.h"
|
||||||
#include "vusb.h"
|
#include "vusb.h"
|
||||||
|
#include "bootloader.h"
|
||||||
|
|
||||||
|
|
||||||
static uint8_t vusb_keyboard_leds = 0;
|
static uint8_t vusb_keyboard_leds = 0;
|
||||||
|
@ -163,6 +166,7 @@ static struct {
|
||||||
uint16_t len;
|
uint16_t len;
|
||||||
enum {
|
enum {
|
||||||
NONE,
|
NONE,
|
||||||
|
BOOTLOADER,
|
||||||
SET_LED
|
SET_LED
|
||||||
} kind;
|
} kind;
|
||||||
} last_req;
|
} last_req;
|
||||||
|
@ -193,6 +197,11 @@ usbRequest_t *rq = (void *)data;
|
||||||
debug("SET_LED: ");
|
debug("SET_LED: ");
|
||||||
last_req.kind = SET_LED;
|
last_req.kind = SET_LED;
|
||||||
last_req.len = rq->wLength.word;
|
last_req.len = rq->wLength.word;
|
||||||
|
#ifdef BOOTLOADER_SIZE
|
||||||
|
} else if(rq->wValue.word == 0x0301) {
|
||||||
|
last_req.kind = BOOTLOADER;
|
||||||
|
last_req.len = rq->wLength.word;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return USB_NO_MSG; // to get data in usbFunctionWrite
|
return USB_NO_MSG; // to get data in usbFunctionWrite
|
||||||
} else {
|
} else {
|
||||||
|
@ -220,6 +229,11 @@ uchar usbFunctionWrite(uchar *data, uchar len)
|
||||||
last_req.len = 0;
|
last_req.len = 0;
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
|
case BOOTLOADER:
|
||||||
|
usbDeviceDisconnect();
|
||||||
|
bootloader_jump();
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
case NONE:
|
case NONE:
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -266,7 +280,7 @@ const PROGMEM uchar keyboard_hid_report[] = {
|
||||||
0x95, 0x06, // Report Count (6),
|
0x95, 0x06, // Report Count (6),
|
||||||
0x75, 0x08, // Report Size (8),
|
0x75, 0x08, // Report Size (8),
|
||||||
0x15, 0x00, // Logical Minimum (0),
|
0x15, 0x00, // Logical Minimum (0),
|
||||||
0x25, 0xFF, 0x00 // Logical Maximum(255),
|
0x25, 0xFF, 0x00, // Logical Maximum(255),
|
||||||
0x05, 0x07, // Usage Page (Key Codes),
|
0x05, 0x07, // Usage Page (Key Codes),
|
||||||
0x19, 0x00, // Usage Minimum (0),
|
0x19, 0x00, // Usage Minimum (0),
|
||||||
0x29, 0xFF, // Usage Maximum (255),
|
0x29, 0xFF, // Usage Maximum (255),
|
||||||
|
@ -336,7 +350,7 @@ const PROGMEM uchar mouse_hid_report[] = {
|
||||||
0xa1, 0x01, // COLLECTION (Application)
|
0xa1, 0x01, // COLLECTION (Application)
|
||||||
0x85, REPORT_ID_SYSTEM, // REPORT_ID (2)
|
0x85, REPORT_ID_SYSTEM, // REPORT_ID (2)
|
||||||
0x15, 0x01, // LOGICAL_MINIMUM (0x1)
|
0x15, 0x01, // LOGICAL_MINIMUM (0x1)
|
||||||
0x25, 0xb7, 0x00 // LOGICAL_MAXIMUM (0xb7)
|
0x25, 0xb7, 0x00, // LOGICAL_MAXIMUM (0xb7)
|
||||||
0x19, 0x01, // USAGE_MINIMUM (0x1)
|
0x19, 0x01, // USAGE_MINIMUM (0x1)
|
||||||
0x29, 0xb7, // USAGE_MAXIMUM (0xb7)
|
0x29, 0xb7, // USAGE_MAXIMUM (0xb7)
|
||||||
0x75, 0x10, // REPORT_SIZE (16)
|
0x75, 0x10, // REPORT_SIZE (16)
|
||||||
|
@ -481,11 +495,11 @@ USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq)
|
||||||
/* interface index */
|
/* interface index */
|
||||||
switch (rq->wIndex.word) {
|
switch (rq->wIndex.word) {
|
||||||
case 0:
|
case 0:
|
||||||
usbMsgPtr = keyboard_hid_report;
|
usbMsgPtr = (unsigned char *)keyboard_hid_report;
|
||||||
len = sizeof(keyboard_hid_report);
|
len = sizeof(keyboard_hid_report);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
usbMsgPtr = mouse_hid_report;
|
usbMsgPtr = (unsigned char *)mouse_hid_report;
|
||||||
len = sizeof(mouse_hid_report);
|
len = sizeof(mouse_hid_report);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue